Refresh design token inventory files to reflect the latest UI sizing and layout configurations from the sandbox prototype.
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
'use client';
|
|
|
|
import React, { useState } from 'react';
|
|
import { Navbar } from './Navbar';
|
|
import { Sidebar } from './Sidebar';
|
|
import { Footer } from './Footer';
|
|
|
|
interface MainLayoutProps {
|
|
children: React.ReactNode;
|
|
showSidebar?: boolean;
|
|
}
|
|
|
|
export const MainLayout: React.FC<MainLayoutProps> = ({
|
|
children,
|
|
showSidebar = false,
|
|
}) => {
|
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
|
|
return (
|
|
<div className="min-h-screen flex flex-col bg-[var(--bg-main)] text-[var(--text)] antialiased">
|
|
<Navbar
|
|
showSidebarToggle={showSidebar}
|
|
onToggleSidebar={() => setSidebarOpen((prev) => !prev)}
|
|
/>
|
|
|
|
<div className="flex-1 flex min-h-0 overflow-hidden">
|
|
{showSidebar && (
|
|
<Sidebar
|
|
isOpen={sidebarOpen}
|
|
onClose={() => setSidebarOpen(false)}
|
|
/>
|
|
)}
|
|
<main className="flex-1 overflow-y-auto flex flex-col min-w-0">
|
|
<div className="flex-1 p-2 sm:p-3.5 max-w-[1360px] w-full mx-auto">
|
|
{children}
|
|
</div>
|
|
<Footer />
|
|
</main>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default MainLayout;
|