27 lines
684 B
TypeScript
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}`}
|
|
/>
|
|
);
|
|
}
|