diff --git a/app/frontend/src/components/FormInput/Textarea.tsx b/app/frontend/src/components/FormInput/Textarea.tsx new file mode 100644 index 000000000..b5bdc4cad --- /dev/null +++ b/app/frontend/src/components/FormInput/Textarea.tsx @@ -0,0 +1,40 @@ +import { Textarea, TextLabel } from '@morak/ui'; + +import * as styles from './index.css'; + +type TextareaProps = React.TextareaHTMLAttributes & { + label?: string; + errorMessage?: string; + fullWidth?: boolean; +}; + +export function FormTextarea({ + label = '', + errorMessage = '', + fullWidth = false, + ...rest +}: TextareaProps) { + const { value, maxLength, required } = rest; + + return ( +
+ {label && ( +
+ + {maxLength && ( + + {value?.toString()?.length || 0}/{maxLength} + + )} +
+ )} +