import { HexString } from '@gear-js/api'; import { useState } from 'react'; import { isHex } from '@/shared/helpers'; import { ProgramTabLayout, SearchForm } from '@/shared/ui'; import { useVoucherFilters, useVouchers } from '../../hooks'; import { Vouchers } from '../vouchers'; import { VoucherFilters } from '../voucher-filters'; type Props = { programId: HexString; }; function ProgramVouchers({ programId }: Props) { const [searchQuery, setSearchQuery] = useState(''); const [filterParams, handleFiltersSubmit] = useVoucherFilters(); const [vouchers, count, isLoading, hasMore, fetchMore, refetch] = useVouchers(searchQuery, filterParams, programId); const renderList = () => ( ); const renderSearch = () => ( schema.refine((value) => isHex(value), 'Value should be hex')} onSubmit={(query) => setSearchQuery(query)} /> ); const renderFilters = () => ; return ( ); } export { ProgramVouchers };