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