"use client"; import * as Dialog from "@radix-ui/react-dialog"; import { useSearchParams } from "next/navigation"; import { DesktopNavigation, NavigationContent, } from "components/ActionBar/DesktopNavigation"; import { Sidebar, useSidebarStore } from "components/ActionBar/Sidebar"; import { DashboardIdContext } from "./dashboardState"; import { NotificationContent } from "./NotificationContent"; export type DashboardShellProps = { id: string; pageTitle: React.ReactNode; publication?: string; actions?: React.ReactNode; tabs?: { [name: string]: { href: string; icon?: React.ReactNode } }; children: React.ReactNode; }; export function DashboardShell(props: DashboardShellProps) { let { id, children, ...navigationProps } = props; let { open, setOpen } = useSidebarStore(); let searchParams = useSearchParams(); let showNotifications = searchParams.get("notifications") === "open"; return (
{ const target = e.target as HTMLElement; const interactive = target.closest("a, button"); if (!interactive) return; if (interactive.getAttribute("aria-haspopup")) return; setOpen(false); }} > Navigation {showNotifications ? : children}
); }