Skip to content

Commit 990a1a7

Browse files
Remove local search filtering in favor of advanced search functionality
Co-authored-by: joaquim.verges <[email protected]>
1 parent a637162 commit 990a1a7

File tree

1 file changed

+2
-41
lines changed
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components

1 file changed

+2
-41
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
useAllEmbeddedWallets,
2222
useEmbeddedWallets,
2323
} from "@/hooks/useEmbeddedWallets";
24-
import { SearchInput } from "./SearchInput";
2524
import { AdvancedSearchInput } from "./AdvancedSearchInput";
2625
import { SearchResults } from "./SearchResults";
2726
import { searchUsers } from "./searchUsers";
@@ -114,7 +113,6 @@ export function InAppWalletUsersPageContent(props: {
114113
}, [props.client]);
115114

116115
const [activePage, setActivePage] = useState(1);
117-
const [searchValue, setSearchValue] = useState("");
118116
const [searchResults, setSearchResults] = useState<WalletUser[]>([]);
119117
const [isSearching, setIsSearching] = useState(false);
120118
const [hasSearchResults, setHasSearchResults] = useState(false);
@@ -124,31 +122,6 @@ export function InAppWalletUsersPageContent(props: {
124122
page: activePage,
125123
});
126124
const wallets = walletsQuery?.data?.users || [];
127-
const filteredWallets = searchValue
128-
? wallets.filter((wallet) => {
129-
const term = searchValue.toLowerCase();
130-
if (wallet.id.toLowerCase().includes(term)) {
131-
return true;
132-
}
133-
if (
134-
wallet.wallets?.some((w) => w.address?.toLowerCase().includes(term))
135-
) {
136-
return true;
137-
}
138-
if (
139-
wallet.linkedAccounts?.some((acc) => {
140-
return Object.values(acc.details).some(
141-
(detail) =>
142-
typeof detail === "string" &&
143-
detail.toLowerCase().includes(term),
144-
);
145-
})
146-
) {
147-
return true;
148-
}
149-
return false;
150-
})
151-
: wallets;
152125
const { mutateAsync: getAllEmbeddedWallets, isPending } =
153126
useAllEmbeddedWallets({
154127
authToken: props.authToken,
@@ -172,7 +145,6 @@ export function InAppWalletUsersPageContent(props: {
172145
const handleClearSearch = () => {
173146
setSearchResults([]);
174147
setHasSearchResults(false);
175-
setSearchValue("");
176148
};
177149

178150
const downloadCSV = useCallback(async () => {
@@ -229,18 +201,7 @@ export function InAppWalletUsersPageContent(props: {
229201
</Button>
230202
</div>
231203

232-
{/* Fallback to old search for table filtering when not using advanced search */}
233-
{!hasSearchResults && (
234-
<div className="flex items-center justify-end gap-3">
235-
<div className="w-full max-w-xs">
236-
<SearchInput
237-
onValueChange={setSearchValue}
238-
placeholder="Filter current page"
239-
value={searchValue}
240-
/>
241-
</div>
242-
</div>
243-
)}
204+
244205
</div>
245206

246207
<div>
@@ -250,7 +211,7 @@ export function InAppWalletUsersPageContent(props: {
250211
<>
251212
<TWTable
252213
columns={columns}
253-
data={filteredWallets}
214+
data={wallets}
254215
isFetched={walletsQuery.isFetched}
255216
isPending={walletsQuery.isPending}
256217
tableContainerClassName="rounded-b-none"

0 commit comments

Comments
 (0)