Fixes double bottom border in Integration List Item (#5026)

* Fixes double bottom border in Integration List Item

* Remove unused import
This commit is contained in:
Hariom Balhara authored and GitHub committed 2022-10-15 11:08:01 -06:00
1 parent 2e83c7fbf8
commit 2d30f673e3
3 files changed
+16 -7

No files matched your search

@@ -4,6 +4,10 @@ import { DynamicComponent } from "./DynamicComponent";
export const AppSettings = (props: { slug: string }) => {
return (
<DynamicComponent<typeof AppSettingsComponentsMap> componentMap={AppSettingsComponentsMap} {...props} />
<DynamicComponent<typeof AppSettingsComponentsMap>
wrapperClassName="border-t border-gray-200"
componentMap={AppSettingsComponentsMap}
{...props}
/>
);
};
@@ -1,9 +1,17 @@
export function DynamicComponent<T extends Record<string, any>>(props: { componentMap: T; slug: string }) {
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 <Component {...rest} />;
return (
<div className={props.wrapperClassName || ""}>
<Component {...rest} />
</div>
);
}