Portal/rsconcept/frontend/src/features/oss/dialogs/DlgCreateOperation/TabSynthesisOperation.tsx

66 lines
1.7 KiB
TypeScript
Raw Normal View History

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