initial commit
This commit is contained in:
1 parent
7cb985116e
commit
75acf7b38f
955 files changed
+37333
-87054
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import Stack from "@mui/material/Stack";
|
||||
import { FieldLabel } from "./FieldLabel";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
|
||||
interface FormFieldProps {
|
||||
label?: string;
|
||||
required?: boolean;
|
||||
children: React.ReactNode;
|
||||
htmlFor?: string;
|
||||
}
|
||||
|
||||
export const FormField: React.FC<FormFieldProps> = ({
|
||||
label,
|
||||
required = false,
|
||||
children,
|
||||
htmlFor,
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<Stack spacing={theme.spacing(2)}>
|
||||
{label && (
|
||||
<FieldLabel required={required} htmlFor={htmlFor}>
|
||||
{label}
|
||||
</FieldLabel>
|
||||
)}
|
||||
{children}
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user