import React, { useState } from 'react' import { Head, router } from '@inertiajs/react' import CustomerLayout from '@/Layouts/CustomerLayout' import { HiChevronLeft } from 'react-icons/hi2' export default function Index({ auth: { user }, notification: { data, next_page_url }, }) { const [_notification, setpoins] = useState(data) const handleNextPage = () => { router.get( next_page_url, {}, { replace: true, preserveState: true, only: ['notification'], onSuccess: (res) => { setpoins(_notification.concat(res.props.notification.data)) }, } ) } return (
{ router.get(route('home.index')) }} >
Notifikasi
{_notification.map((notification) => (
{notification.format_created_at}
{notification.description}
))} {next_page_url !== null && (
Load more
)}
) }