MIF_E31221222/sigap-website/app/_components/form-field.tsx

18 lines
405 B
TypeScript

import { Label } from "./ui/label";
interface FormFieldProps {
label: string;
input: React.ReactNode;
error?: string;
}
export function FormField({ label, input, error }: FormFieldProps) {
return (
<div className="space-y-2">
<Label className="text-sm text-gray-300">{label}</Label>
{input}
{error && <p className="text-red-500 text-xs mt-1">{error}</p>}
</div>
);
}