Files
calendar/packages/app-store/_components/DynamicComponent.tsx
T
Hariom BalharaandGitHub 2d30f673e3 Fixes double bottom border in Integration List Item (#5026)
* Fixes double bottom border in Integration List Item

* Remove unused import
2022-10-15 11:08:01 -06:00

18 lines
384 B
TypeScript

export function DynamicComponent<T extends Record<string, any>>(props: {
componentMap: T;
slug: string;
wrapperClassName?: string;
}) {
const { componentMap, slug, ...rest } = props;
if (!componentMap[slug]) return null;
const Component = componentMap[slug];
return (
<div className={props.wrapperClassName || ""}>
<Component {...rest} />
</div>
);
}