import { deleteAuth } from '@/core/utils/auth'
import Link from '../Link/Link'
import { useRouter } from 'next/router'

const NavbarUserDropdown = () => {
  const router = useRouter()

  const logout = () => {
    deleteAuth()
    router.push('/login')
  }

  return (
    <div className='navbar-user-dropdown-wrapper'>
      <div className='navbar-user-dropdown'>
        <Link href='/my/transactions'>Daftar Transaksi</Link>
        <Link href='/my/invoices'>Invoice & Faktur Pajak</Link>
        <Link href='/my/wishlist'>Wishlist</Link>
        <Link href='/'>Pengaturan Akun</Link>
        <button type='button' onClick={logout}>
          Keluar Akun
        </button>
      </div>
    </div>
  )
}

export default NavbarUserDropdown
