import React, { useState, useEffect } from 'react' import { Head, Link, router } from '@inertiajs/react' import { usePrevious } from 'react-use' 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' 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 (
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
) }