ldc-bien-etre-animal/resources/ts/front/Components/Form/TextInput.tsx
2026-08-31 12:40:30 +02:00

27 lines
685 B
TypeScript

import { type InputHTMLAttributes } from "react";
type TextInputProps = InputHTMLAttributes<HTMLInputElement> & {
label: string;
required?: boolean;
error?: string;
};
export default function TextInput({
label,
required,
error,
className = "",
...props
}: Readonly<TextInputProps>) {
return (
<input
{...props}
placeholder={`${label}${required ? "*" : ""}`}
required={required}
className={`w-full rounded-full border-4 lowercase placeholder:uppercase bg-white px-6 py-4 font-poppins-bold text-body text-bleu outline-none placeholder:text-bleu
${className}
${error ? "border-rouge" : "border-bleu"}
`}
/>
);
}