mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 06:44:58 +00:00
22 lines
607 B
TypeScript
22 lines
607 B
TypeScript
import React, { forwardRef } from 'react'
|
|
import classNames from 'classnames'
|
|
import styles from '../../../scss/atoms/form.module.scss'
|
|
|
|
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
testId?: string
|
|
error?: boolean
|
|
}
|
|
|
|
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
({ error, testId, className = '', ...props }, ref) => (
|
|
<textarea
|
|
ref={ref}
|
|
className={classNames(styles.textarea, error && styles.textareaError, className)}
|
|
data-testid={testId}
|
|
{...props}
|
|
/>
|
|
)
|
|
)
|
|
|
|
Textarea.displayName = 'Textarea'
|