import React, { useContext, useEffect, useMemo } from "react";
import { useSelector } from "react-redux";
import { IfContext } from "./If";
const objectPath = require("object-path");
/**
* Componente que usando el contexto if solo muestra el contenido si se cumple la condicion declarada en el if que lo contiene, o en cualquiera de las condiciones
* @name Reactor.Components.Templates.IfThen
* @class
* @example
<if variable="nombre_variable" context="un_contexto" value="valor" operator="=" type="text">
<then>
contenido condicional
</then>
<else>
contenido en caso contrario
</else>
</if>
*/
export const IfThen = ({children}) => {
const { match } = useContext(IfContext);
return (
<>
{match ? children : <></>}
</>
)
}