import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
const useComponent = (component, defaults)=>{
    const { components } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.SchemaOptionsContext);
    if (!component) return defaults;
    if ('string' != typeof component) return component;
    return (0, __WEBPACK_EXTERNAL_MODULE_lodash__.get)(components, component) || defaults;
};
export { useComponent };
