2024-07-21 15:19:57 +03:00
|
|
|
import FlexColumn from '@/components/ui/FlexColumn';
|
|
|
|
import Label from '@/components/ui/Label';
|
|
|
|
import TextArea from '@/components/ui/TextArea';
|
|
|
|
import TextInput from '@/components/ui/TextInput';
|
|
|
|
import AnimateFade from '@/components/wrap/AnimateFade';
|
2024-07-26 21:09:16 +03:00
|
|
|
import { IOperationSchema, OperationID } from '@/models/oss';
|
2024-07-21 15:19:57 +03:00
|
|
|
|
2024-07-26 21:09:16 +03:00
|
|
|
import PickMultiOperation from '../../components/select/PickMultiOperation';
|
|
|
|
|
2024-07-21 15:19:57 +03:00
|
|
|
interface TabSynthesisOperationProps {
|
|
|
|
oss: IOperationSchema;
|
|
|
|
alias: string;
|
2024-11-21 00:26:16 +03:00
|
|
|
onChangeAlias: (newValue: string) => void;
|
2024-07-21 15:19:57 +03:00
|
|
|
title: string;
|
2024-11-21 00:26:16 +03:00
|
|
|
onChangeTitle: (newValue: string) => void;
|
2024-07-21 15:19:57 +03:00
|
|
|
comment: string;
|
2024-11-21 00:26:16 +03:00
|
|
|
onChangeComment: (newValue: string) => void;
|
2024-07-26 17:31:57 +03:00
|
|
|
inputs: OperationID[];
|
2024-07-21 15:19:57 +03:00
|
|
|
setInputs: React.Dispatch<React.SetStateAction<OperationID[]>>;
|
|
|
|
}
|
|
|
|
|
|
|
|
function TabSynthesisOperation({
|
|
|
|
oss,
|
|
|
|
alias,
|
2024-11-21 00:26:16 +03:00
|
|
|
onChangeAlias,
|
2024-07-21 15:19:57 +03:00
|
|
|
title,
|
2024-11-21 00:26:16 +03:00
|
|
|
onChangeTitle,
|
2024-07-21 15:19:57 +03:00
|
|
|
comment,
|
2024-11-21 00:26:16 +03:00
|
|
|
onChangeComment,
|
2024-07-26 17:31:57 +03:00
|
|
|
inputs,
|
2024-07-21 15:19:57 +03:00
|
|
|
setInputs
|
|
|
|
}: TabSynthesisOperationProps) {
|
|
|
|
return (
|
|
|
|
<AnimateFade className='cc-column'>
|
|
|
|
<TextInput
|
|
|
|
id='operation_title'
|
|
|
|
label='Полное название'
|
|
|
|
value={title}
|
2024-11-21 00:26:16 +03:00
|
|
|
onChange={event => onChangeTitle(event.target.value)}
|
2024-07-21 15:19:57 +03:00
|
|
|
/>
|
|
|
|
<div className='flex gap-6'>
|
|
|
|
<TextInput
|
|
|
|
id='operation_alias'
|
|
|
|
label='Сокращение'
|
2024-08-22 23:24:10 +03:00
|
|
|
className='w-[16rem]'
|
2024-07-21 15:19:57 +03:00
|
|
|
value={alias}
|
2024-11-21 00:26:16 +03:00
|
|
|
onChange={event => onChangeAlias(event.target.value)}
|
2024-07-21 15:19:57 +03:00
|
|
|
/>
|
|
|
|
|
|
|
|
<TextArea
|
|
|
|
id='operation_comment'
|
|
|
|
label='Описание'
|
|
|
|
noResize
|
|
|
|
rows={3}
|
|
|
|
value={comment}
|
2024-11-21 00:26:16 +03:00
|
|
|
onChange={event => onChangeComment(event.target.value)}
|
2024-07-21 15:19:57 +03:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
2024-07-26 21:09:16 +03:00
|
|
|
<FlexColumn>
|
|
|
|
<Label text={`Выбор аргументов: [ ${inputs.length} ]`} />
|
|
|
|
<PickMultiOperation items={oss.items} selected={inputs} setSelected={setInputs} rows={6} />
|
|
|
|
</FlexColumn>
|
2024-07-21 15:19:57 +03:00
|
|
|
</AnimateFade>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default TabSynthesisOperation;
|