stargaze-studio/components/Conditional.tsx
2022-07-13 16:56:36 +03:00

12 lines
240 B
TypeScript

import type { ReactNode } from 'react'
export interface ConditionalProps {
test: boolean
children: ReactNode
}
export const Conditional = ({ test, children }: ConditionalProps) => {
if (!test) return null
return <>{children}</>
}