import React from 'react' import { Head, router } from '@inertiajs/react' import { toast } from 'react-toastify' import { HiOutlineBell } from 'react-icons/hi' import { HiChevronRight, HiClipboardDocumentList, HiOutlineUserCircle, } from 'react-icons/hi2' import CustomerLayout from '@/Layouts/CustomerLayout' import { useModalState } from '@/hooks' import ModalConfirm from '@/Components/ModalConfirm' import BalanceBanner from '../Index/BalanceBanner' export default function Index({ auth: { user }, notification_count }) { const confirmModal = useModalState() const handleLogoutClick = () => { confirmModal.toggle() } const onLogout = () => { router.post(route('customer.logout')) } const handleCopyToClipboard = (text) => { toast.info('copied to clipboard') navigator.clipboard.writeText(text) } return (
{/* user */}
{user.image_url !== null ? ( profile image ) : ( )}
{user.name}
{user.display_phone}
{user.level.name}
{ router.get(route('notification.index')) }} >
{notification_count}
{/* saldo */}
handleCopyToClipboard(user.referral_code) } >
Referral Code:
{user.referral_code}
{user.is_allow_paylater && (
router.get(route('customer.paylater.index')) } >
Paylater
)}
router.get(route('customer.verification')) } >
Upgrade Member
router.get(route('customer.deposit.index')) } >
Deposit Saldo
router.get(route('customer.coin.index'))} >
Riwayat Coin
router.get(route('transactions.index'))} >
Transaksi
{ router.get(route('notification.index')) }} >
Notifikasi
router.get(route('customer.profile.show')) } >
Profile
handleLogoutClick()} className="flex flex-row justify-between items-center px-2 py-4 w-full border-b border-gray-400 text-red-700 hover:bg-gray-100" > Logout
) }