33 lines
647 B
TypeScript
33 lines
647 B
TypeScript
import { Input } from '@/components/ui/input';
|
|
import { Label } from '@/components/ui/label';
|
|
|
|
export default function LabeledInput({
|
|
type,
|
|
label,
|
|
placeholder,
|
|
value,
|
|
name,
|
|
autocomplete,
|
|
}: {
|
|
type: 'text' | 'email' | 'password';
|
|
label: string;
|
|
placeholder?: string;
|
|
value?: string;
|
|
name?: string;
|
|
autocomplete?: string;
|
|
}) {
|
|
return (
|
|
<div className='grid grid-cols-1 gap-1'>
|
|
<Label htmlFor={name}>{label}</Label>
|
|
|
|
<Input
|
|
type={type}
|
|
placeholder={placeholder}
|
|
defaultValue={value}
|
|
id={name}
|
|
name={name}
|
|
autoComplete={autocomplete}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|