import { jsx } from "react/jsx-runtime";
import "react";
import { RecursionField, observer, useField, useFieldSchema } from "@tachybase/schema";
import { useActionContext } from "./index.mjs";
import { ActionDrawer } from "./Action.Drawer.mjs";
import { ActionModal } from "./Action.Modal.mjs";
import { ActionPage } from "./Action.Page.mjs";
import { ActionSheet } from "./Action.Sheet.mjs";
const ActionContainer = observer((props)=>{
    const { openMode } = useActionContext();
    if ('drawer' === openMode) return /*#__PURE__*/ jsx(ActionDrawer, {
        footerNodeName: 'Action.Container.Footer',
        ...props
    });
    if ('modal' === openMode) return /*#__PURE__*/ jsx(ActionModal, {
        footerNodeName: 'Action.Container.Footer',
        ...props
    });
    if ('sheet' === openMode) return /*#__PURE__*/ jsx(ActionSheet, {
        footerNodeName: 'Action.Container.Footer',
        ...props
    });
    return /*#__PURE__*/ jsx(ActionPage, {
        footerNodeName: 'Action.Container.Footer',
        ...props
    });
}, {
    displayName: 'ActionContainer'
});
ActionContainer.Footer = observer(()=>{
    const field = useField();
    const schema = useFieldSchema();
    return /*#__PURE__*/ jsx(RecursionField, {
        basePath: field.address,
        schema: schema,
        onlyRenderProperties: true
    });
}, {
    displayName: 'ActionContainer.Footer'
});
const Action_Container = ActionContainer;
export { ActionContainer, Action_Container as default };
