Files
dmenu-admin/src/components/Textarea.tsx
T
hamid zarghami 7130c304c5 Create order
2026-06-23 12:31:39 +03:30

43 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { type FC, type InputHTMLAttributes } from 'react'
import Error from './Error'
import { clx } from '../helpers/utils'
type Props = {
label?: string,
error_text?: string
isNotRequired?: boolean
} & InputHTMLAttributes<HTMLTextAreaElement>
const Textarea: FC<Props> = (props: Props) => {
return (
<div className='w-full relative'>
{
props.label &&
<div className='flex items-center gap-1'>
<div className='text-sm'>{props.label}</div>
{props.isNotRequired && (
<span className='text-xs text-description'>(اختیاری)</span>
)}
</div>
}
<textarea
{...props}
className={clx(
'border border-border leading-7 w-full rounded-xl px-4 py-3 min-h-[100px] mt-1 text-xs',
props.className
)}
>
</textarea>
{
props.error_text &&
<Error errorText={props.error_text} />
}
</div>
)
}
export default Textarea