Skip to content

Commit

Permalink
fix bug status filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tientran1234 committed Jun 27, 2024
1 parent 78d6413 commit d0d2198
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/users/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export default function Account(): JSX.Element {
const [page, setPage] = React.useState(1);
const hasSearchFilter = Boolean(filterValue);
const hasFilterRole = Boolean(filterRole);

const filteredItems = React.useMemo(() => {
let filteredUsers = [...users];
if (hasFilterRole) {
Expand All @@ -69,6 +68,7 @@ export default function Account(): JSX.Element {
statusFilter !== "all" &&
Array.from(statusFilter).length !== statusOptions.length
) {
setPage(1);
filteredUsers = filteredUsers.filter((user) =>
Array.from(statusFilter).includes(user.status),
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/users/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const columns = [
export const statusOptions = [
{ name: "Active", uid: "active" },
{ name: "Paused", uid: "paused" },
{ name: "Block", uid: "block" },
{ name: "Block", uid: "blocked" },
];
export const users = [
{
Expand Down

0 comments on commit d0d2198

Please sign in to comment.