import React from 'react'
import { WebNoAuthentication } from './Empty'
import { useLogin2p } from 'Login2p/Login2pContext'

// type ContextProviderProps = { children: React.ReactNode }
type ValidateLogin2pProps = {
  children: React.ReactNode
}

const ValidateLogin2p: React.FC<ValidateLogin2pProps> = props => {
  const login2p = useLogin2p()
  return !login2p.jwt ? <WebNoAuthentication /> : <>{props.children}</>
}

export default ValidateLogin2p
