import type { SxProps, Theme } from '@mui/material/styles'; import { styled } from '@mui/material/styles'; // ---------------------------------------------------------------------- type MailLayoutProps = React.ComponentProps<'div'> & { sx?: SxProps; slots: { nav: React.ReactNode; list: React.ReactNode; header: React.ReactNode; details: React.ReactNode; }; slotProps?: { nav?: React.ComponentProps; list?: React.ComponentProps; details?: React.ComponentProps; container?: React.ComponentProps; }; }; export function MailLayout({ slots, slotProps, sx, ...other }: MailLayoutProps) { return ( {slots.header} {slots.nav} {slots.list} {slots.details} ); } // ---------------------------------------------------------------------- const LayoutRoot = styled('div')(() => ({ display: 'flex', flexDirection: 'column', })); const LayoutContainer = styled('div')(({ theme }) => ({ gap: theme.spacing(1), display: 'flex', flex: '1 1 auto', overflow: 'hidden', })); const LayoutNav = styled('div')(({ theme }) => ({ display: 'none', flex: '0 0 200px', overflow: 'hidden', flexDirection: 'column', [theme.breakpoints.up('md')]: { display: 'flex' }, })); const LayoutList = styled('div')(({ theme }) => ({ display: 'none', flex: '0 0 320px', overflow: 'hidden', flexDirection: 'column', borderRadius: theme.shape.borderRadius * 1.5, backgroundColor: theme.vars.palette.background.default, [theme.breakpoints.up('md')]: { display: 'flex' }, })); const LayoutDetails = styled('div')(({ theme }) => ({ minWidth: 0, display: 'flex', flex: '1 1 auto', overflow: 'hidden', flexDirection: 'column', borderRadius: theme.shape.borderRadius * 1.5, backgroundColor: theme.vars.palette.background.default, }));