import { createComponent } from '..'; import { transformComponentKey } from '../componentMap'; import { ConfigType, CreateComponentType, PublicComponentOptions } from '../index.type'; export const useGetComponentConfig = ( key: string, options: Partial = {} ): CreateComponentType => { try { const config = createComponent({ key: transformComponentKey(key) } as ConfigType, options); if (!config) console.error(`can not get component config by component key (${key})`); return config; } catch (error) { console.error(`can not get component config by component key (${key})`); return {} as CreateComponentType; } };