import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../../../schema-component/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_table_v2_Table_Column_Decorator_mjs__ from "../../../../schema-component/antd/table-v2/Table.Column.Decorator.mjs";
function useFieldComponentName() {
    var _fieldSchema_xcomponentprops, _field_componentProps, _collectionField_uiSchema;
    const { fieldSchema: tableColumnSchema, collectionField } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_antd_table_v2_Table_Column_Decorator_mjs__.useColumnSchema)();
    const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
    const isFileField = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useIsFileField)();
    const schema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    const fieldSchema = tableColumnSchema || schema;
    const map = {
        AssociationField: 'Select'
    };
    const fieldComponentName = (null == fieldSchema ? void 0 : null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : _fieldSchema_xcomponentprops['mode']) || (null == field ? void 0 : null === (_field_componentProps = field.componentProps) || void 0 === _field_componentProps ? void 0 : _field_componentProps['mode']) || (isFileField ? 'FileManager' : '') || (null == collectionField ? void 0 : null === (_collectionField_uiSchema = collectionField.uiSchema) || void 0 === _collectionField_uiSchema ? void 0 : _collectionField_uiSchema['x-component']);
    return map[fieldComponentName] || fieldComponentName;
}
export { useFieldComponentName };
