import React, { type PropsWithChildren } from "react";

type Props = {
  with: () => boolean;
} & PropsWithChildren

const Protected: React.FC<Props> = props =>
  props.with() ? <>{props.children}</> : <UserLogin />;


// <Protected with={()-> isLoggedIn}><Profile/></Protected>