import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import "react";
import { observer } from "@tachybase/schema";
import { AssociationFieldProvider } from "./AssociationFieldProvider.mjs";
import { FileManageReadPretty } from "./FileManager.mjs";
import { useAssociationFieldContext } from "./hooks.mjs";
import { InternalNester } from "./InternalNester.mjs";
import { InternalSubTable } from "./InternalSubTable.mjs";
import { ReadPrettyInternalTag } from "./InternalTag.mjs";
import { ReadPrettyInternalViewer } from "./InternalViewer.mjs";
const ReadPrettyAssociationField = observer((props)=>{
    const { currentMode } = useAssociationFieldContext();
    return /*#__PURE__*/ jsxs(Fragment, {
        children: [
            [
                'Select',
                'Picker',
                'CascadeSelect',
                'Cascader',
                'CustomTitle'
            ].includes(currentMode) && /*#__PURE__*/ jsx(ReadPrettyInternalViewer, {
                ...props
            }),
            'Tag' === currentMode && /*#__PURE__*/ jsx(ReadPrettyInternalTag, {
                ...props
            }),
            'Nester' === currentMode && /*#__PURE__*/ jsx(InternalNester, {
                ...props
            }),
            'SubTable' === currentMode && /*#__PURE__*/ jsx(InternalSubTable, {
                ...props
            }),
            'FileManager' === currentMode && /*#__PURE__*/ jsx(FileManageReadPretty, {
                ...props
            })
        ]
    });
}, {
    displayName: 'ReadPrettyAssociationField'
});
const ReadPretty = observer((props)=>/*#__PURE__*/ jsx(AssociationFieldProvider, {
        children: /*#__PURE__*/ jsx(ReadPrettyAssociationField, {
            ...props
        })
    }), {
    displayName: 'ReadPretty'
});
export { ReadPretty };
