import React, { useState, useEffect } from 'react'
import { usePage, router, Link } from '@inertiajs/react'
import { usePrevious } from 'react-use'
import { HiOutlineFilter } from 'react-icons/hi'
import { HiOutlineQuestionMarkCircle } from 'react-icons/hi2'
import { useModalState } from '@/hooks'
import BottomSheet from './BottomSheet'
import FormInputDateRanger from '@/Components/FormInputDateRange'
const FilterSheet = ({ state, dates, setDates, setApply }) => {
const apply = () => {
setApply(true)
state.toggle()
}
return (
state.toggle()}>
Filter Tanggal
setDates(dates)}
/>
apply()}
className="mt-5 font-semibold h-11 border bg-blue-700 text-white px-5 py-2 rounded-full hover:text-black hover:bg-white"
>
Apply
)
}
export default function HeaderTrx({ enable = 'deposit', dates, setDates }) {
const {
props: {
auth: { user },
},
} = usePage()
const filterModal = useModalState()
const [popover, setPopover] = useState(false)
const [isApply, setApply] = useState(false)
return (
<>
Rp {user.display_deposit}
router.get(route('transactions.deposit.topup'))
}
>
Top Up
Deposit
Pembelian
Poin
filterModal.toggle()}
>
{/* only show on filter */}
{isApply && (
)}
>
)
}