import React from "react";

export function Conditional({ 
  condition, 
  truthy, 
  falsy 
}:{
  condition: boolean, 
  truthy: React.ReactNode, 
  falsy: React.ReactNode
}) {
  return condition ? truthy : falsy;
}

export function ConditionalNull({ 
  condition, 
  children 
}:{
  condition: boolean, 
  children: React.ReactNode, 
}) {
  return condition ? children : <></>;
}

export function ConditionalParent({ 
  condition, 
  parent, 
  children 
}:{
  condition: boolean,
  parent: (childNode:React.ReactNode) => React.ReactNode,  
  children: React.ReactNode
}) {
  return condition ? parent(children) : children;
}
