import {Redirect} from 'expo-router'
import {FunctionComponent} from 'react'

import useUser from '@/hooks/useUser'

const Index: FunctionComponent = () => {
  const user = useUser()

  if (!user) {
    return <Redirect href="/(tabs)/login" />
  }

  return <Redirect href="/(tabs)/account" />
}

export default Index
