Files
MonkeyCode/ui/src/components/form/index.tsx

30 lines
587 B
TypeScript

import { styled, FormLabel, Box } from '@mui/material';
export const StyledFormLabel = styled(FormLabel)(({ theme }) => ({
display: 'block',
color: theme.vars.palette.text.primary,
fontSize: 14,
fontWeight: 400,
marginBottom: theme.spacing(1),
[theme.breakpoints.down('sm')]: {
fontSize: 14,
},
}));
export const FormItem = ({
label,
children,
required,
}: {
label: string;
children: React.ReactNode;
required?: boolean;
}) => {
return (
<Box>
<StyledFormLabel required={required}>{label}</StyledFormLabel>
{children}
</Box>
);
};