mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-11 11:13:40 +08:00
30 lines
587 B
TypeScript
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>
|
|
);
|
|
};
|