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 [paylaters, setPaylaters] = useState(data)
const handleNextPage = () => {
router.get(
next_page_url,
{},
{
replace: true,
preserveState: true,
only: ['histories'],
onSuccess: (res) => {
setPaylaters(paylaters.concat(res.props.histories.data))
},
}
)
}
return (