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

27 lines
684 B
TypeScript

import { type TextareaHTMLAttributes } from "react";
type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
label: string;
required?: boolean;
error?: string;
};
export default function TextArea({
label,
required,
error,
className = "",
...props
}: Readonly<TextAreaProps>) {
return (
<textarea
{...props}
placeholder={`${label}${required ? "*" : ""}`}
required={required}
rows={5}
className={`w-full resize-none rounded-[24px] border-4 bg-white px-6 py-4 font-poppins-bold text-body text-bleu outline-none placeholder:text-bleu
${error ? "border-rouge" : "border-bleu"}
${className}`}
/>
);
}