import { Navigate } from 'react-router-dom'
import { useMe } from '@features/auth'
import { ROUTES } from '@shared/config/routes'
import { KycWidget } from '@widgets/kyc-verification'
import styles from './KycPage.module.css'

export function KycPage() {
  const { data, isLoading } = useMe()

  if (isLoading) return null
  if (data?.kyc_verified) return <Navigate to={ROUTES.PROFILE} replace />

  return (
    <div className={styles.page}>
      <KycWidget />
    </div>
  )
}
