import { jsx } from "react/jsx-runtime";
import { useFieldSchema } from "@tachybase/schema";
import { Space } from "antd";
import { useDesignable } from "../../index.mjs";
import { useSchemaSettingsRender } from "../../../application/schema-settings/hooks/index.mjs";
import { SchemaToolbarProvider } from "../../../application/schema-toolbar/context/index.mjs";
const PageDesigner = (param)=>{
    let { title } = param;
    const { designable } = useDesignable();
    const fieldSchema = useFieldSchema();
    const { render } = useSchemaSettingsRender(fieldSchema['x-settings'] || 'PageSettings', fieldSchema['x-settings-props']);
    if (!designable) return null;
    return /*#__PURE__*/ jsx(SchemaToolbarProvider, {
        title: title,
        children: /*#__PURE__*/ jsx("div", {
            className: 'general-schema-designer',
            children: /*#__PURE__*/ jsx("div", {
                className: 'general-schema-designer-icons',
                children: /*#__PURE__*/ jsx(Space, {
                    size: 2,
                    align: 'center',
                    children: render()
                })
            })
        })
    });
};
export { PageDesigner };
