File tree Expand file tree Collapse file tree
apps/web/src/app/(dashboard)/contacts/[contactBookId] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,9 +96,15 @@ export default function ContactList({
9696 } ) ;
9797
9898 const debouncedSearch = useDebouncedCallback ( ( value : string ) => {
99- setSearch ( value ) ;
99+ setSearch ( value || null ) ;
100+ setPage ( "1" ) ;
100101 } , 1000 ) ;
101102
103+ const handleStatusChange = ( val : string ) => {
104+ setStatus ( val === "All" ? null : val ) ;
105+ setPage ( "1" ) ;
106+ } ;
107+
102108 const exportQuery = api . contacts . exportContacts . useQuery (
103109 {
104110 contactBookId,
@@ -182,10 +188,7 @@ export default function ContactList({
182188 />
183189 </ div >
184190 < div className = "flex gap-2" >
185- < Select
186- value = { status ?? "All" }
187- onValueChange = { ( val ) => setStatus ( val === "All" ? null : val ) }
188- >
191+ < Select value = { status ?? "All" } onValueChange = { handleStatusChange } >
189192 < SelectTrigger className = "w-[180px] capitalize" >
190193 { status || "All statuses" }
191194 </ SelectTrigger >
You can’t perform that action at this time.
0 commit comments