import React , { ReactNode } from 'react' ; import { useSelector } from 'react-redux' ; import { selectProfile } from 'features/auth/authSlice' ; import { VerifyEmail } from 'features/auth/VerifyEmail' ; import { Box } from '@chakra-ui/core/dist' ; type Props = { children : ReactNode ; } ; param { React . ReactElement < any , string | React . JSXElementConstructor < any > > | string | number | { } | React . ReactNodeArray | React . ReactPortal | boolean | null | undefined } children param { Pick < Props , never > } rest returns { any } constructor export const VerifiedUser = ( { children , ... rest } ) => { const profile = useSelector ( selectProfile ) ; return < > { profile . emailVerified ? < Box { ... rest } > { children } < /Box> : <VerifyEmail {...rest}/ > } < />; } ;