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