import { Card } from "./ui/card"; import { Button } from "./ui/button"; import { Badge } from "./ui/badge"; import { AlertTriangle, CheckCircle2, Clock, TrendingUp, Package, FileCheck, MessageSquare, ArrowRight, Bell, Camera, Activity } from "lucide-react"; type Tab = "dashboard" | "inventory" | "protocol"; interface DashboardProps { setActiveTab: (tab: Tab) => void; } export function Dashboard({ setActiveTab }: DashboardProps) { const stats = [ { label: "Chemicals Tracked", value: "252", icon: Package, color: "text-[#5a9584]" }, { label: "Low Stock (<20%)", value: "2", icon: AlertTriangle, color: "text-amber-600" }, { label: "Expiring Soon", value: "3", icon: Clock, color: "text-red-600" }, { label: "Protocols Reviewed", value: "12", icon: FileCheck, color: "text-[#2d5a4a]" }, ]; const lowStockAlerts = [ { chemical: "Sodium Hydroxide", location: "Cabinet B-1", percentFull: 15, lab: "Lab 305" }, { chemical: "Ethanol", location: "Cabinet A-5", percentFull: 18, lab: "Lab 201" }, ]; const expirationAlerts = [ { chemical: "Hydrochloric Acid", location: "Acid Cabinet", daysLeft: -2, status: "expired", lab: "Lab 201" }, { chemical: "Benzene", location: "Flammables Cabinet", daysLeft: 15, status: "expiring-soon", lab: "Lab 305" }, { chemical: "Acetone", location: "Cabinet A-3", daysLeft: 28, status: "expiring-soon", lab: "Lab 201" }, ]; const recentActivity = [ { action: "Scanned and added Methanol via photo", time: "30 mins ago", type: "inventory" }, { action: "Protocol safety review completed", time: "2 hours ago", type: "protocol" }, { action: "Low stock alert: Sodium Hydroxide", time: "4 hours ago", type: "alert" }, { action: "Expiration reminder sent for 3 chemicals", time: "1 day ago", type: "reminder" }, ]; const alerts = [ { message: "Hydrochloric Acid expired 2 days ago - requires disposal", severity: "critical" }, { message: "Sodium Hydroxide below 20% full - reorder needed", severity: "warning" }, { message: "3 chemicals expiring in next 30 days", severity: "warning" }, ]; return (

Welcome to Labwise

Your AI-powered lab safety and compliance assistant

{/* Stats Grid */}
{stats.map((stat) => { const Icon = stat.icon; return (

{stat.label}

{stat.value}

); })}
{/* Quick Actions */}

AI Safety Assistant

Ask questions with sourced answers

Check Protocol

Get AI safety feedback

Scan Chemical

Photo capture with auto-fill

{/* Low Stock Alerts */}

Low Stock Alerts

{lowStockAlerts.map((alert, idx) => (
setActiveTab("inventory")} >

{alert.chemical}

{alert.lab} • {alert.location}

{alert.percentFull}% full
))}
{/* Expiration Alerts */}

Expiration Alerts

{expirationAlerts.map((alert, idx) => (
setActiveTab("inventory")} >

{alert.chemical}

{alert.lab} • {alert.location}

{alert.status === 'expired' ? `Expired ${Math.abs(alert.daysLeft)}d ago` : `${alert.daysLeft}d left`}
))}
{/* Recent Activity */}

Recent Activity

{recentActivity.map((activity, idx) => (

{activity.action}

{activity.time}

))}
{/* Safety Alerts */}

Safety Alerts

{alerts.map((alert, idx) => (

{alert.message}

))}
); }