2024-07-29 16:56:24 +03:00
|
|
|
'use client';
|
2025-02-10 01:32:55 +03:00
|
|
|
import { FlexColumn } from '@/components/Container';
|
|
|
|
import { Label } from '@/components/Input';
|
2024-07-29 16:56:24 +03:00
|
|
|
|
2025-02-10 01:32:55 +03:00
|
|
|
import PickMultiOperation from '../../components/PickMultiOperation';
|
|
|
|
import { IOperationSchema, OperationID } from '../../models/oss';
|
2024-07-29 16:56:24 +03:00
|
|
|
|
|
|
|
interface TabArgumentsProps {
|
|
|
|
oss: IOperationSchema;
|
|
|
|
target: OperationID;
|
|
|
|
inputs: OperationID[];
|
|
|
|
setInputs: React.Dispatch<React.SetStateAction<OperationID[]>>;
|
|
|
|
}
|
|
|
|
|
|
|
|
function TabArguments({ oss, inputs, target, setInputs }: TabArgumentsProps) {
|
2024-12-13 21:31:09 +03:00
|
|
|
const potentialCycle = [target, ...oss.graph.expandAllOutputs([target])];
|
|
|
|
const filtered = oss.items.filter(item => !potentialCycle.includes(item.id));
|
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
|
|
|
<FlexColumn>
|
|
|
|
<Label text={`Выбор аргументов: [ ${inputs.length} ]`} />
|
2025-02-04 20:35:55 +03:00
|
|
|
<PickMultiOperation items={filtered} value={inputs} onChange={setInputs} rows={8} />
|
2024-07-29 16:56:24 +03:00
|
|
|
</FlexColumn>
|
2024-12-12 13:19:12 +03:00
|
|
|
</div>
|
2024-07-29 16:56:24 +03:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default TabArguments;
|