import { jsx } from "react/jsx-runtime";
import "react";
import { FormOutlined } from "@ant-design/icons";
import { SchemaInitializerItem, useSchemaInitializer, useSchemaInitializerItem } from "../../../../application/index.mjs";
import { useCollection_deprecated } from "../../../../collection-manager/index.mjs";
import { createTableSelectorUISchema } from "./createTableSelectorUISchema.mjs";
const TableSelectorInitializer = ()=>{
    const itemConfig = useSchemaInitializerItem();
    const { onCreateBlockSchema, componentType, createBlockSchema, ...others } = itemConfig;
    const { insert } = useSchemaInitializer();
    const collection = useCollection_deprecated();
    return /*#__PURE__*/ jsx(SchemaInitializerItem, {
        icon: /*#__PURE__*/ jsx(FormOutlined, {}),
        ...others,
        onClick: async ()=>{
            insert(createTableSelectorUISchema({
                rowKey: collection.filterTargetKey,
                collectionName: collection.name,
                dataSource: collection.dataSource
            }));
        }
    });
};
export { TableSelectorInitializer };
