2025-02-12 00:14:38 +03:00
|
|
|
import { useFormContext } from 'react-hook-form';
|
|
|
|
|
2025-03-12 11:55:43 +03:00
|
|
|
import { TextArea, TextInput } from '@/components/input1';
|
2024-07-29 16:56:24 +03:00
|
|
|
|
2025-02-21 21:15:05 +03:00
|
|
|
import { type IOperationUpdateDTO } from '../../backend/types';
|
2025-02-12 00:14:38 +03:00
|
|
|
|
2025-02-19 23:30:35 +03:00
|
|
|
export function TabOperation() {
|
2025-02-12 00:14:38 +03:00
|
|
|
const {
|
|
|
|
register,
|
|
|
|
formState: { errors }
|
|
|
|
} = useFormContext<IOperationUpdateDTO>();
|
2024-07-29 16:56:24 +03:00
|
|
|
|
|
|
|
return (
|
2024-12-12 13:19:12 +03:00
|
|
|
<div className='cc-fade-in cc-column'>
|
2024-07-29 16:56:24 +03:00
|
|
|
<TextInput
|
|
|
|
id='operation_title'
|
|
|
|
label='Полное название'
|
2025-02-12 00:14:38 +03:00
|
|
|
{...register('item_data.title')}
|
|
|
|
error={errors.item_data?.title}
|
2024-07-29 16:56:24 +03:00
|
|
|
/>
|
|
|
|
<div className='flex gap-6'>
|
2024-07-30 16:00:09 +03:00
|
|
|
<TextInput
|
|
|
|
id='operation_alias'
|
|
|
|
label='Сокращение'
|
2025-03-09 21:59:21 +03:00
|
|
|
className='w-64'
|
2025-02-12 00:14:38 +03:00
|
|
|
{...register('item_data.alias')}
|
|
|
|
error={errors.item_data?.alias}
|
2024-07-30 16:00:09 +03:00
|
|
|
/>
|
2024-07-29 16:56:24 +03:00
|
|
|
|
|
|
|
<TextArea
|
|
|
|
id='operation_comment'
|
|
|
|
label='Описание'
|
|
|
|
noResize
|
|
|
|
rows={3}
|
2025-02-12 00:14:38 +03:00
|
|
|
{...register('item_data.comment')}
|
|
|
|
error={errors.item_data?.comment}
|
2024-07-29 16:56:24 +03:00
|
|
|
/>
|
|
|
|
</div>
|
2024-12-12 13:19:12 +03:00
|
|
|
</div>
|
2024-07-29 16:56:24 +03:00
|
|
|
);
|
|
|
|
}
|