import React, { useState } from 'react' import { Head, router } from '@inertiajs/react' import CustomerLayout from '@/Layouts/CustomerLayout' import HeaderTrx from '../Components/HeaderTrx' const EmptyHere = () => { return (
Transaksi kosong
Yuk kumpulkan poin sebanyak banyaknya dengan share link refferal kamu
) } export default function Index({ auth: { user }, poins: { data, next_page_url }, }) { const [_poins, setpoins] = useState(data) const handleNextPage = () => { router.get( next_page_url, {}, { replace: true, preserveState: true, only: ['poins'], onSuccess: (res) => { setpoins(_poins.concat(res.props.poins.data)) }, } ) } return (
{_poins.length <= 0 && }
{_poins.map((poin) => (
router.get( route('transactions.poin.show', poin.id) ) } >
{poin.format_human_created_at}
{poin.description}
{poin.amount}
))} {next_page_url !== null && (
Load more
)}
) }