webapp/src/components/_shared/ConditionalWrapper/ConditionalWrapper.tsx
2023-08-11 19:42:41 +03:00

12 lines
275 B
TypeScript

import { JSX } from 'solid-js'
type Props = {
condition: boolean
wrapper: (children: JSX.Element) => JSX.Element
children: JSX.Element
}
export const ConditionalWrapper = (props: Props) => {
return props.condition ? props.wrapper(props.children) : props.children
}