'use client'; import { useEffect, useState } from 'react'; import { Logo } from '@/components/Logo'; import type { IServiceRecentDashboards } from '@/server/services/dashboard.service'; import type { IServiceOrganization } from '@/server/services/organization.service'; import { cn } from '@/utils/cn'; import { Rotate as Hamburger } from 'hamburger-react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import LayoutMenu from './layout-menu'; import LayoutOrganizationSelector from './layout-organization-selector'; interface LayoutSidebarProps { recentDashboards: IServiceRecentDashboards; organizations: IServiceOrganization[]; } export function LayoutSidebar({ organizations, recentDashboards, }: LayoutSidebarProps) { const [active, setActive] = useState(false); const fallbackProjectId = recentDashboards[0]?.project_id ?? null; const pathname = usePathname(); useEffect(() => { setActive(false); }, [pathname]); return ( <>