'use client'; import { useEffect } from 'react'; import { MiniButton } from '@/components/Control'; import { IconReset } from '@/components/Icons'; import { Checkbox, Label, TextArea, TextInput } from '@/components/Input'; import { useLibrary } from '@/features/library/backend/useLibrary'; import { ILibraryItem, LibraryItemID, LibraryItemType } from '@/features/library/models/library'; import { IOperationSchema } from '@/features/oss/models/oss'; import { sortItemsForOSS } from '@/features/oss/models/ossAPI'; import PickSchema from '@/features/rsform/components/PickSchema'; interface TabInputOperationProps { oss: IOperationSchema; alias: string; onChangeAlias: (newValue: string) => void; title: string; onChangeTitle: (newValue: string) => void; comment: string; onChangeComment: (newValue: string) => void; attachedID: LibraryItemID | undefined; onChangeAttachedID: (newValue: LibraryItemID | undefined) => void; createSchema: boolean; onChangeCreateSchema: (newValue: boolean) => void; } function TabInputOperation({ oss, alias, onChangeAlias, title, onChangeTitle, comment, onChangeComment, attachedID, onChangeAttachedID, createSchema, onChangeCreateSchema }: TabInputOperationProps) { const { items: libraryItems } = useLibrary(); const sortedItems = sortItemsForOSS(oss, libraryItems); function baseFilter(item: ILibraryItem) { return !oss.schemas.includes(item.id); } useEffect(() => { if (createSchema) { onChangeAttachedID(undefined); } }, [createSchema, onChangeAttachedID]); return (