import React, { useState } from 'react'
import { Head, router } from '@inertiajs/react'
import CustomerLayout from '@/Layouts/CustomerLayout'
export default function Index({
auth: { user },
coins: { data, next_page_url },
}) {
const [_coins, setCoins] = useState(data)
const handleNextPage = () => {
router.get(
next_page_url,
{},
{
replace: true,
preserveState: true,
only: ['coins'],
onSuccess: (res) => {
setCoins(_coins.concat(res.props.coins.data))
},
}
)
}
return (