This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/components/design/Textarea/Textarea.tsx

30 lines
872 B
TypeScript
Raw Normal View History

2022-08-31 21:44:33 +02:00
import type { TextareaAutosizeProps } from 'react-textarea-autosize'
import TextareaAutosize from 'react-textarea-autosize'
2022-01-14 23:15:51 +01:00
export interface TextareaProps extends TextareaAutosizeProps {
label: string
}
export const Textarea: React.FC<TextareaProps> = (props) => {
const { label, id, ...rest } = props
return (
<div className='flex flex-col'>
2023-04-03 00:11:19 +02:00
<div className='mb-2 mt-6 flex justify-between'>
2022-01-14 23:15:51 +01:00
<label className='pl-1' htmlFor={id}>
{label}
</label>
</div>
<div className='relative mt-0'>
2022-01-14 23:15:51 +01:00
<TextareaAutosize
className='w-full resize-none overflow-hidden rounded-lg bg-[#f1f1f1] p-3 font-paragraph text-[#2a2a2a] caret-green-600 focus:border focus:shadow-green focus:outline-none'
2022-01-14 23:15:51 +01:00
wrap='soft'
id={id}
name={id}
{...rest}
/>
</div>
</div>
)
}