import { TextareaHTMLAttributes, ReactNode, useId, forwardRef } from 'react'; import cx from 'clsx'; import styles from './textarea.module.scss'; type Props = Omit, 'id' | 'size'> & { size?: 'default' | 'small'; label?: string; error?: ReactNode; block?: boolean; }; const Textarea = forwardRef( ({ className, label, error, size = 'default', rows = 5, placeholder = ' ', block, ...attrs }, ref) => { const { disabled } = attrs; const id = useId(); return ( {label && ( {label} )} {label} {error && {error}} ); }, ); export { Textarea }; export type { Props as TextareaProps };
{error}