'use client' import Link from 'next/link' import { usePathname, useRouter } from 'next/navigation' import { useState } from 'react' import { createClient } from '@/lib/supabase/client' import { LayoutDashboard, ListChecks, FolderKanban, Settings2, MessageSquare, Users, CreditCard, BookUser, Download, LogOut, ChevronDown } from 'lucide-react' const NAV = [ { section: 'WORKSPACE', items: [ { label: 'Dashboard', href: '/dashboard', icon: LayoutDashboard }, { label: 'Tasks & Chores', href: '/tasks', icon: ListChecks, badge: 7 }, { label: 'Projects', href: '/projects', icon: FolderKanban }, { label: 'Ops & Facilities', href: '/ops', icon: Settings2 }, { label: 'Comms', href: '/comms', icon: MessageSquare, badge: 3 }, ], }, { section: 'PEOPLE', items: [ { label: 'Members', href: '/members', icon: Users }, { label: 'Payments', href: '/payments', icon: CreditCard, badge: 12, badgeColor: 'text-orange-500 bg-orange-500/10' }, { label: 'Contacts', href: '/contacts', icon: BookUser }, ], }, { section: 'ADMIN', items: [ { label: 'Import / Sync', href: '/import', icon: Download }, { label: 'Settings', href: '/settings', icon: Settings2 }, ], }, ] interface Props { member: any space: any children: React.ReactNode } export default function AppShell({ member, space, children }: Props) { const pathname = usePathname() const router = useRouter() const [signingOut, setSigningOut] = useState(false) async function signOut() { setSigningOut(true) const supabase = createClient() await supabase.auth.signOut() router.push('/login') } const initials = (member.display_name || 'U') .split(' ') .map((n: string) => n[0]) .join('') .toUpperCase() .slice(0, 2) return (
{/* Sidebar */} {/* Main content */}
{children}
) }