import type { ElementType, ReactNode } from 'react'; import { Box, Stack } from '@mui/material'; import { alpha } from '@mui/material/styles'; import { SectionPaper } from './SectionPaper'; import { SectionTitle } from './SectionTitle'; /** * A framed card for the small data-entry screens (assign destination, manual input, close a permit, truck inquiry...): * icon + title, the fields, and a footer strip with the buttons. Same frame as every record section. */ export function FormCard({ icon, title, children, actions, maxWidth = 760 }: { icon: ElementType; title: string; children: ReactNode; /** Buttons shown in a tinted footer strip. */ actions?: ReactNode; maxWidth?: number | string; }) { return ( {children} {actions && ( ({ flexWrap: 'wrap', px: { xs: 2, sm: 2.5 }, py: 1.5, borderTop: 1, borderColor: 'divider', bgcolor: alpha(t.palette.primary.main, t.palette.mode === 'dark' ? 0.08 : 0.04) })} > {actions} )} ); } /** Two columns of fields on wide screens, one on phones. */ export function FormGrid({ children }: { children: ReactNode }) { return {children}; }