import React from 'react' import { Head, router } from '@inertiajs/react' import { HiOutlineBell } from 'react-icons/hi' import { HiChevronRight, HiClipboardDocumentList, HiOutlineUserCircle, } from 'react-icons/hi2' import { toastSuccess } from '../utils' import { useModalState } from '@/hooks' import CustomerLayout from '@/Layouts/CustomerLayout' import ModalConfirm from '@/Components/ModalConfirm' import BalanceBanner from '../Index/Partials/BalanceBanner' export default function Index({ auth: { user }, notification_count, share_text, }) { const confirmModal = useModalState() const handleLogoutClick = () => { confirmModal.toggle() } const onLogout = () => { router.post(route('customer.logout')) } const handleReferalCopyToClipboard = (code) => { toastSuccess('copied to clipboard') const text = share_text + '\n' + route('customer.register', { referral_code: code }) navigator.clipboard.writeText(text) } return (
{/* user */}
{user.image_url !== null ? ( profile image ) : ( )}
{user.name}
{user.username}
{user.level.name}
{ router.get(route('notification.index')) }} >
{notification_count}
{/* saldo */}
handleReferalCopyToClipboard(user.referral_code) } >
Referral Code:
{user.referral_code}
{user.is_allow_paylater && (
router.get(route('customer.paylater.index')) } >
Mitra WBB
)}
router.get(route('customer.verification')) } >
Upgrade Member
router.get(route('transactions.deposit.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
) }