import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "./index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__ from "../../schema-settings/index.mjs";
const Def = ()=>null;
const useDesigner = ()=>{
    const { designable } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useDesignable)();
    const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    const toolbar = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
        if (fieldSchema['x-designer'] || fieldSchema['x-toolbar']) return fieldSchema['x-designer'] || fieldSchema['x-toolbar'];
        if (fieldSchema['x-settings']) return __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__.SchemaToolbar;
        return Def;
    }, [
        fieldSchema
    ]);
    const component = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useComponent)(toolbar);
    return designable ? component || Def : Def;
};
export { useDesigner };
