import { useEffect } from "react"; import { observer } from "mobx-react"; import { useRouter } from "next/router"; import { BarChart2, PanelRight } from "lucide-react"; // ui import { Breadcrumbs } from "@plane/ui"; // components import { BreadcrumbLink } from "@/components/common"; import { cn } from "@/helpers/common.helper"; import { useAppTheme } from "@/hooks/store"; export const WorkspaceAnalyticsHeader = observer(() => { const router = useRouter(); const { analytics_tab } = router.query; // store hooks const { workspaceAnalyticsSidebarCollapsed, toggleWorkspaceAnalyticsSidebar } = useAppTheme(); useEffect(() => { const handleToggleWorkspaceAnalyticsSidebar = () => { if (window && window.innerWidth < 768) { toggleWorkspaceAnalyticsSidebar(true); } if (window && workspaceAnalyticsSidebarCollapsed && window.innerWidth >= 768) { toggleWorkspaceAnalyticsSidebar(false); } }; window.addEventListener("resize", handleToggleWorkspaceAnalyticsSidebar); handleToggleWorkspaceAnalyticsSidebar(); return () => window.removeEventListener("resize", handleToggleWorkspaceAnalyticsSidebar); }, [toggleWorkspaceAnalyticsSidebar, workspaceAnalyticsSidebarCollapsed]); return ( <>