Files
gridpilot.gg/apps/website/components/dashboard/DashboardShell.tsx
2026-01-17 15:46:55 +01:00

40 lines
1.2 KiB
TypeScript

import React from 'react';
import { Box } from '@/ui/Box';
interface DashboardShellProps {
children: React.ReactNode;
rail?: React.ReactNode;
controlBar?: React.ReactNode;
}
/**
* DashboardShell
*
* The primary layout container for the Telemetry Workspace.
* Orchestrates the sidebar rail, top control bar, and main content area.
* Uses UI primitives to comply with architectural constraints.
*/
export function DashboardShell({ children, rail, controlBar }: DashboardShellProps) {
return (
<Box display="flex" h="screen" overflow="hidden" bg="base-black" color="white">
{rail && (
<Box as="aside" w="16" flexShrink={0} borderRight bg="surface-charcoal" borderColor="var(--color-outline)">
{rail}
</Box>
)}
<Box display="flex" flexGrow={1} flexDirection="col" overflow="hidden">
{controlBar && (
<Box as="header" h="14" borderBottom bg="surface-charcoal" borderColor="var(--color-outline)">
{controlBar}
</Box>
)}
<Box as="main" flexGrow={1} overflow="auto" p={6}>
<Box maxWidth="7xl" mx="auto" display="flex" flexDirection="col" gap={6}>
{children}
</Box>
</Box>
</Box>
</Box>
);
}