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