mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 23:16:03 +01:00
feat(web/input): textarea row
This commit is contained in:
31
web/src/features/dialog/components/fields/textarea.tsx
Normal file
31
web/src/features/dialog/components/fields/textarea.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Textarea } from '@mantine/core';
|
||||
import { UseFormRegisterReturn } from 'react-hook-form';
|
||||
import { ITextarea } from '../../../../interfaces/dialog';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import React from 'react';
|
||||
|
||||
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 && <FontAwesomeIcon 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;
|
||||
Reference in New Issue
Block a user