mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +01:00
32 lines
878 B
TypeScript
32 lines
878 B
TypeScript
import { Textarea } from '@mantine/core';
|
|
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
import { ITextarea } from '../../../../typings/dialog';
|
|
import React from 'react';
|
|
import LibIcon from '../../../../components/LibIcon';
|
|
|
|
interface Props {
|
|
register: UseFormRegisterReturn;
|
|
row: ITextarea;
|
|
index: number;
|
|
}
|
|
|
|
const TextareaField: React.FC<Props> = (props) => {
|
|
return (
|
|
<Textarea
|
|
{...props.register}
|
|
defaultValue={props.row.default}
|
|
label={props.row.label}
|
|
description={props.row.description}
|
|
icon={props.row.icon && <LibIcon icon={props.row.icon} fixedWidth />}
|
|
placeholder={props.row.placeholder}
|
|
disabled={props.row.disabled}
|
|
withAsterisk={props.row.required}
|
|
autosize={props.row.autosize}
|
|
minRows={props.row.min}
|
|
maxRows={props.row.max}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default TextareaField;
|