import { isValid, useFieldSchema } from "@tachybase/schema";
import { useSchemaToolbar } from "../../../application/index.mjs";
import { SchemaSettings } from "../../../application/schema-settings/SchemaSettings.mjs";
import { useCollection_deprecated } from "../../../collection-manager/index.mjs";
import { ButtonEditor, SecondConFirm, WorkflowConfig } from "../../../schema-component/antd/action/Action.Designer.mjs";
import { SchemaSettingsLinkageRules } from "../../../schema-settings/index.mjs";
const deleteActionSettings = new SchemaSettings({
    name: 'actionSettings:delete',
    items: [
        {
            name: 'editButton',
            Component: ButtonEditor,
            useComponentProps () {
                const { buttonEditorProps } = useSchemaToolbar();
                return buttonEditorProps;
            }
        },
        {
            name: 'linkageRules',
            Component: SchemaSettingsLinkageRules,
            useComponentProps () {
                const { name } = useCollection_deprecated();
                const { linkageRulesProps } = useSchemaToolbar();
                return {
                    ...linkageRulesProps,
                    collectionName: name
                };
            }
        },
        {
            name: 'secondConFirm',
            Component: SecondConFirm
        },
        {
            name: 'workflowConfig',
            Component: WorkflowConfig,
            useVisible () {
                var _fieldSchema_xactionsettings;
                const fieldSchema = useFieldSchema();
                return isValid(null == fieldSchema ? void 0 : null == (_fieldSchema_xactionsettings = fieldSchema['x-action-settings']) ? void 0 : _fieldSchema_xactionsettings.triggerWorkflows);
            }
        },
        {
            name: 'delete',
            type: 'remove'
        }
    ]
});
export { deleteActionSettings };
