"use client"; import { Avatar } from "@azmr/ui/avatar"; import { Breadcrumbs } from "@azmr/ui/breadcrumb"; import { Button } from "@azmr/ui/button"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@azmr/ui/disclosure"; import { Badge, Card, CardContent, CardDescription, CardHeader, CardTitle, Skeleton, } from "@azmr/ui/display"; import { Icon } from "@azmr/ui/icons"; import { Grid } from "@azmr/ui/layout"; import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, } from "@azmr/ui/menu"; import { Progress } from "@azmr/ui/progress"; import { CreditCard, LayoutDashboard, RefreshCw, Settings, Users } from "lucide-react"; import { useEffect, useState } from "react"; const NAV = [ { id: "overview", label: "Overview", icon: LayoutDashboard }, { id: "customers", label: "Customers", icon: Users }, { id: "billing", label: "Billing", icon: CreditCard }, { id: "settings", label: "Settings", icon: Settings }, ]; const STATS = [ { label: "Revenue", value: "$48,200", change: "+12%", tone: "success" as const }, { label: "Customers", value: "1,284", change: "+38", tone: "success" as const }, { label: "Open invoices", value: "17", change: "+4", tone: "warning" as const }, { label: "Churn", value: "1.9%", change: "-0.3%", tone: "success" as const }, ]; const ACTIVITY = [ "Hemi Te Rangi upgraded to Enterprise", "Invoice INV-204 was paid by Aroha Ngata", "Tane Smith's card failed", "Mere Walker started a trial", ]; // A dashboard shell is a navigation list, a top bar and a content area. The navigation marks the // current page with aria-current, and the content area is a labelled region, so a screen reader // user can jump to either. Real apps would use their router's links where these use #. export default function DashboardShell() { const [page, setPage] = useState("overview"); const [loading, setLoading] = useState(false); useEffect(() => { if (!loading) return; const timer = setTimeout(() => setLoading(false), 1200); return () => clearTimeout(timer); }, [loading]); const current = NAV.find((item) => item.id === page) ?? NAV[0]; return (
} /> {/* A label has to sit inside a group, which is also how it is announced. */} aroha@example.co.nz Profile Sign out

{current?.label}

{STATS.map((stat) => ( {stat.label} {loading ? ( ) : ( {stat.value} )} {!loading && {stat.change}} ))}

{loading ? "Refreshing figures" : "Figures are up to date"}

Usage Activity
    {ACTIVITY.map((line) => (
  • {line}
  • ))}
); }