import React, { useState, useEffect } from 'react' import { Head, router } from '@inertiajs/react' import { HiEye } from 'react-icons/hi' import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout' import Pagination from '@/Components/Pagination' import SearchInput from '@/Components/SearchInput' import { formatIDR } from '@/utils' import { usePrevious } from 'react-use' export default function Info(props) { const { query: { links, data }, } = props const [search, setSearch] = useState('') const preValue = usePrevious(search) const params = { q: search } useEffect(() => { if (preValue) { router.get( route(route().current()), { q: search }, { replace: true, preserveState: true, } ) } }, [search]) return (
{/* {canCreate && ( )} */}
setSearch(e.target.value)} value={search} />
{data.map((sale) => ( ))}
# Customer Tanggal Voucher Total
{sale.code} {sale.customer.name} {sale.format_created_at} {formatIDR( sale.items_count )} {formatIDR(sale.amount)} router.get( route( 'sale.show', sale ) ) } >
Lihat
) }