fix: use name prop for label and input id in LabeledInput component
All checks were successful
container-scan / Container Scan (pull_request) Successful in 1m57s
docker-build / docker (pull_request) Successful in 3m16s

This commit is contained in:
Maximilian Liebmann 2025-05-13 14:22:09 +02:00
parent 74d7a10cf1
commit 9116dd1085

View file

@ -6,23 +6,24 @@ export default function LabeledInput({
label, label,
placeholder, placeholder,
value, value,
name,
}: { }: {
type: 'text' | 'email' | 'password'; type: 'text' | 'email' | 'password';
label: string; label: string;
placeholder?: string; placeholder?: string;
value?: string; value?: string;
name?: string;
}) { }) {
const elementId = Math.random().toString(36).substring(2, 15);
return ( return (
<div className='flex flex-col gap-1'> <div className='flex flex-col gap-1'>
<Label htmlFor={elementId}>{label}</Label> <Label htmlFor={name}>{label}</Label>
<Input <Input
type={type} type={type}
placeholder={placeholder} placeholder={placeholder}
defaultValue={value} defaultValue={value}
id={elementId} id={name}
name={name}
/> />
</div> </div>
); );