'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import type { ReactNode } from 'react'; import { ThemeToggle } from '@/components/shell/ThemeToggle'; import { Badge } from '@/components/ui/Badge'; import { Button } from '@/components/ui/Button'; import { cx } from '@/lib/cx'; import { signOutAction } from '@/server/auth/actions'; import { isActive, NAVIGATION, placeholderHref, sectionForPath, sectionHref, type NavItem, } from '@/components/shell/navigation'; export interface AppShellProps { children: ReactNode; initials: string; fullName: string; roleName: string; accountName: string; } export function AppShell({ children, initials, fullName, roleName, accountName, }: AppShellProps) { const pathname = usePathname(); const section = sectionForPath(pathname); return (
PlanFlow {initials} {`${fullName}, ${roleName}`}
{children}
); } function SidebarLink({ item, pathname }: { item: NavItem; pathname: string }) { const current = item.href ? isActive(item.href, pathname) : false; const className = cx( 'flex w-full items-center justify-between gap-2 rounded-2 px-2.5 py-1.5 text-left text-sm', 'transition-colors duration-[var(--d-1)] ease-organic', current ? 'bg-accent-soft font-semibold text-accent-soft-ink' : 'text-ink-2 hover:bg-surface-2', ); const content = ( <> {item.label} {item.badge ? ( {item.badge} ) : null} ); if (!item.href) { return ( {content} ); } return ( {content} ); }