diff --git a/frontend/src/components/utilities/ShouldWrapComponent.tsx b/frontend/src/components/utilities/ShouldWrapComponent.tsx new file mode 100644 index 000000000..f6503d35d --- /dev/null +++ b/frontend/src/components/utilities/ShouldWrapComponent.tsx @@ -0,0 +1,20 @@ +import { ReactNode, ComponentType } from "react"; + +type ShouldWrapProps> = { + children: ReactNode; + wrapper: ComponentType; + isWrapped?: boolean; +} & T; + +export const ShouldWrap = >({ + children, + wrapper: Wrapper, + isWrapped = false, + ...wrapperProps +}: ShouldWrapProps) => { + if (isWrapped) { + return {children}; + } + + return children; +}; diff --git a/frontend/src/components/v2/Divider/Divider.tsx b/frontend/src/components/v2/Divider/Divider.tsx index 39b0f84c5..a5b755eeb 100644 --- a/frontend/src/components/v2/Divider/Divider.tsx +++ b/frontend/src/components/v2/Divider/Divider.tsx @@ -7,7 +7,7 @@ interface IProps { export const Divider = ({ className }: IProps): JSX.Element => { return (
-