12 lines
240 B
TypeScript
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}</>
|
||
|
}
|