mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
32 lines
1 KiB
TypeScript
32 lines
1 KiB
TypeScript
|
|
import { Textarea as MantineTextarea, TextareaProps as MantineTextareaProps } from '@mantine/core';
|
||
|
|
import { CSSProperties, forwardRef } from 'react';
|
||
|
|
|
||
|
|
import styles from './textarea.module.css';
|
||
|
|
|
||
|
|
export interface TextareaProps extends MantineTextareaProps {
|
||
|
|
maxWidth?: CSSProperties['maxWidth'];
|
||
|
|
width?: CSSProperties['width'];
|
||
|
|
}
|
||
|
|
|
||
|
|
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||
|
|
({ children, classNames, maxWidth, style, width, ...props }: TextareaProps, ref) => {
|
||
|
|
return (
|
||
|
|
<MantineTextarea
|
||
|
|
classNames={{
|
||
|
|
input: styles.input,
|
||
|
|
label: styles.label,
|
||
|
|
required: styles.required,
|
||
|
|
root: styles.root,
|
||
|
|
wrapper: styles.wrapper,
|
||
|
|
...classNames,
|
||
|
|
}}
|
||
|
|
ref={ref}
|
||
|
|
style={{ maxWidth, width, ...style }}
|
||
|
|
{...props}
|
||
|
|
>
|
||
|
|
{children}
|
||
|
|
</MantineTextarea>
|
||
|
|
);
|
||
|
|
},
|
||
|
|
);
|