"use client"; import { useState } from "react"; import { usePathname, useRouter } from "next/navigation"; import { useSdk, useFeatureFlags } from "@lynkd/messaging-inbox-sdk"; import { useUi } from "@/lib/ui-state"; import { IconButton } from "@/components/ui/primitives"; import { Home, MessageSquare, Inbox as InboxIcon, Bell, LifeBuoy, MoreHorizontal, Plus } from "lucide-react"; import clsx from "clsx"; /** Slack-style far-left rail: workspace switcher + primary destinations. */ export function WorkspaceRail() { const { bootstrap, brandName } = useSdk(); const flags = useFeatureFlags(); const router = useRouter(); const pathname = usePathname(); const { setNotifOpen, openModal, toast } = useUi(); const workspaces = bootstrap?.workspaces ?? []; const [activeWs, setActiveWs] = useState(bootstrap?.workspace?.id); const nav = [ { icon: Home, label: "Home", href: "/", match: (p: string) => p === "/" || p.startsWith("/c/") }, flags.messaging && { icon: MessageSquare, label: "DMs", href: "/dms", match: (p: string) => p.startsWith("/dms") }, flags.inbox && { icon: InboxIcon, label: "Inbox", href: "/inbox", match: (p: string) => p.startsWith("/inbox") }, flags.support && { icon: LifeBuoy, label: "Support", href: "/support", match: (p: string) => p.startsWith("/support") }, ].filter(Boolean) as { icon: typeof Home; label: string; href: string; match: (p: string) => boolean }[]; const active = activeWs ?? bootstrap?.workspace?.id; return ( ); }