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 } }) { 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}
1
{/* saldo */}
handleCopyToClipboard(user.referral_code) } >
Referral Code:
{user.referral_code}
Upgrade Member
router.get(route('customer.deposit.index')) } >
Deposit Saldo
router.get(route('customer.coin.index'))} >
Coin
router.get(route('transactions.index'))} >
Transaksi
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
) }