2024-07-29 16:55:48 +03:00
|
|
|
import TextArea from '@/components/ui/TextArea';
|
|
|
|
import TextInput from '@/components/ui/TextInput';
|
|
|
|
import AnimateFade from '@/components/wrap/AnimateFade';
|
|
|
|
import { limits, patterns } from '@/utils/constants';
|
|
|
|
|
|
|
|
interface TabOperationProps {
|
|
|
|
alias: string;
|
|
|
|
setAlias: React.Dispatch<React.SetStateAction<string>>;
|
|
|
|
title: string;
|
|
|
|
setTitle: React.Dispatch<React.SetStateAction<string>>;
|
|
|
|
comment: string;
|
|
|
|
setComment: React.Dispatch<React.SetStateAction<string>>;
|
|
|
|
}
|
|
|
|
|
2024-07-30 15:59:37 +03:00
|
|
|
function TabOperation({ alias, setAlias, title, setTitle, comment, setComment }: TabOperationProps) {
|
2024-07-29 16:55:48 +03:00
|
|
|
return (
|
|
|
|
<AnimateFade className='cc-column'>
|
|
|
|
<TextInput
|
|
|
|
id='operation_title'
|
|
|
|
label='Полное название'
|
|
|
|
value={title}
|
|
|
|
onChange={event => setTitle(event.target.value)}
|
|
|
|
/>
|
|
|
|
<div className='flex gap-6'>
|
2024-07-30 15:59:37 +03:00
|
|
|
<TextInput
|
|
|
|
id='operation_alias'
|
|
|
|
label='Сокращение'
|
|
|
|
className='w-[14rem]'
|
|
|
|
pattern={patterns.library_alias}
|
|
|
|
title={`не более ${limits.library_alias_len} символов`}
|
|
|
|
value={alias}
|
|
|
|
onChange={event => setAlias(event.target.value)}
|
|
|
|
/>
|
2024-07-29 16:55:48 +03:00
|
|
|
|
|
|
|
<TextArea
|
|
|
|
id='operation_comment'
|
|
|
|
label='Описание'
|
|
|
|
noResize
|
|
|
|
rows={3}
|
|
|
|
value={comment}
|
|
|
|
onChange={event => setComment(event.target.value)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</AnimateFade>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default TabOperation;
|