Files
temetro/frontend/components/sidebar-02/app-sidebar.tsx
T
Khalid Abdi 97bf9ed8cc Build temetro app: dark theme, clinical sidebar, AI chat, settings page
- Linear-inspired dark theme (app/globals.css), forced dark in layout
- Clinical sidebar (components/sidebar-02) with temetro brand
- AI chat UI (components/chat): Cursor-style input, UI-only mock replies
- Settings page (components/settings): Polar-style tabs/sections, UI only
- Route-group app shell: app/(app)/{layout,page,settings}
- shadcn (Base UI) + ai-elements component libraries
- CLAUDE.md: architecture notes + per-folder commit policy

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 20:25:19 +03:00

139 lines
3.3 KiB
TypeScript

"use client";
import {
Sidebar,
SidebarContent,
SidebarFooter,
SidebarHeader,
SidebarTrigger,
useSidebar,
} from "@/components/ui/sidebar";
import { cn } from "@/lib/utils";
import { motion } from "framer-motion";
import {
Bookmark,
MessageSquare,
Plus,
Settings,
Users,
} from "lucide-react";
import Image from "next/image";
import { Logo } from "@/components/sidebar-02/logo";
import type { Route } from "./nav-main";
import DashboardNavigation from "@/components/sidebar-02/nav-main";
import { NotificationsPopover } from "@/components/sidebar-02/nav-notifications";
import { TeamSwitcher } from "@/components/sidebar-02/team-switcher";
const sampleNotifications = [
{
id: "1",
avatar: "/avatars/01.png",
fallback: "LR",
text: "New lab results are available.",
time: "10m ago",
},
{
id: "2",
avatar: "/avatars/02.png",
fallback: "PC",
text: "A patient chart was updated.",
time: "1h ago",
},
{
id: "3",
avatar: "/avatars/03.png",
fallback: "CT",
text: "New message from the care team.",
time: "2h ago",
},
];
const dashboardRoutes: Route[] = [
{
id: "new-chat",
title: "New chat",
icon: <Plus className="size-4" />,
link: "/",
},
{
id: "patients",
title: "Patients",
icon: <Users className="size-4" />,
link: "#",
},
{
id: "conversations",
title: "Conversations",
icon: <MessageSquare className="size-4" />,
link: "#",
},
{
id: "saved",
title: "Saved",
icon: <Bookmark className="size-4" />,
link: "#",
},
{
id: "settings",
title: "Settings",
icon: <Settings className="size-4" />,
link: "/settings",
},
];
const teams = [{ id: "1", name: "temetro", logo: Logo, plan: "Clinic" }];
export function DashboardSidebar() {
const { state } = useSidebar();
const isCollapsed = state === "collapsed";
return (
<Sidebar variant="inset" collapsible="icon">
<SidebarHeader
className={cn(
"flex md:pt-3.5",
isCollapsed
? "flex-row items-center justify-between gap-y-4 md:flex-col md:items-start md:justify-start"
: "flex-row items-center justify-between"
)}
>
<a href="#" className="flex items-center gap-2">
<Image
src="/temetro-logo.png"
alt="temetro"
width={32}
height={32}
className="size-8 shrink-0"
priority
/>
{!isCollapsed && (
<span className="font-semibold text-black dark:text-white">
temetro
</span>
)}
</a>
<motion.div
key={isCollapsed ? "header-collapsed" : "header-expanded"}
className={cn(
"flex items-center gap-2",
isCollapsed ? "flex-row md:flex-col-reverse" : "flex-row"
)}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.8 }}
>
<NotificationsPopover notifications={sampleNotifications} />
<SidebarTrigger />
</motion.div>
</SidebarHeader>
<SidebarContent className="gap-4 px-2 py-4">
<DashboardNavigation routes={dashboardRoutes} />
</SidebarContent>
<SidebarFooter className="px-2">
<TeamSwitcher teams={teams} />
</SidebarFooter>
</Sidebar>
);
}