"use client"; // ============================================================ // Dashboard shell — premium dark theme. Keeps the sidebar + // header and swaps the inner content. Profile / Support / Rules // render real views; other workspace modules show a placeholder. // ============================================================ import { useEffect, useState } from "react"; import { Sidebar, NAV_ITEMS } from "./sidebar"; import { Topbar } from "./topbar"; import { ToastProvider, PageHead, Btn, Icon } from "./ui"; import { Profile } from "./profile"; import { Support } from "./support"; import { Rules } from "./rules"; import { AiAssistant } from "./ai-assistant"; import { TeamManagement } from "./team-management"; import { MessengerSdk } from "./messenger-sdk"; import { InboxSdk } from "./inbox-sdk"; import { Settings } from "./settings"; import { SmartGallery } from "./smart-gallery"; import "../../app/dashboard/dashboard.css"; export function Dashboard() { const [theme, setTheme] = useState<"dark" | "light">("dark"); const [active, setActive] = useState("dashboard"); // Deep link from global search: which conversation to focus once we switch tabs. const [deepLink, setDeepLink] = useState<{ surface: "messenger" | "inbox"; threadId: string } | null>(null); function navigateToConversation(surface: "messenger" | "inbox", threadId: string) { setActive(surface); setDeepLink({ surface, threadId }); } useEffect(() => { // Sync the persisted theme from localStorage (an external system) on mount. // eslint-disable-next-line react-hooks/set-state-in-effect try { const t = localStorage.getItem("lup_dash_theme"); if (t === "light" || t === "dark") setTheme(t); } catch {} }, []); function toggle() { setTheme((t) => { const n = t === "dark" ? "light" : "dark"; try { localStorage.setItem("lup_dash_theme", n); } catch {} return n; }); } const item = NAV_ITEMS.find((i) => i.key === active); const title = item?.label ?? "Dashboard"; const subtitle = item?.subtitle ?? "Workspace module"; return (
This area is reserved for the {title} module. In the meantime, the account experience is fully built out.