import { Stack } from '@mui/material';
import { composeSx } from '@utils/components';

import { type DrawerBodyProps } from '../types';

/**
 * Drawer.Body - Simple content section with scroll support
 */
export function DrawerBody({ children, slotProps }: DrawerBodyProps) {
  return (
    <Stack
      {...slotProps}
      sx={composeSx(
        {
          p: 3,
          overflowY: 'auto',
          flexGrow: 1,
          maxWidth: theme => theme.breakpoints.values.lg,
        },
        slotProps?.sx,
      )}
    >
      {children}
    </Stack>
  );
}
