import type { ReactNode } from 'react'; import { Outlet } from 'react-router-dom'; import { Sidebar, SidebarContent, useSidebar } from '../sidebar'; import classNames from 'classnames'; import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id'; export const LayoutWithSidebar = ({ header, sidebar, }: { header?: ReactNode; sidebar?: ReactNode; }) => { const currentRouteId = useGetCurrentRouteId(); const views = useSidebar((store) => store.views); const sidebarView = views[currentRouteId] || null; const sidebarOpen = sidebarView !== null; const gridClasses = classNames( 'h-full relative z-0 grid', 'grid-rows-[min-content_1fr_50px]', 'lg:grid-rows-[min-content_1fr]', 'lg:grid-cols-[1fr_280px_40px]', 'xxxl:grid-cols-[1fr_320px_40px]' ); return (
{header}
); };