feat: more filters

This commit is contained in:
TrèsAbhi committed 2023-12-04 12:35:27 -06:00
1 parent 7020e5641f
commit b503f4fa8f
5 files changed
+151 -40

No files matched your search

+7 -2
View File
@@ -1,7 +1,8 @@
import { produce } from 'immer';
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
import { TIERS, Tier } from '../core/blitzkrieg/tankopedia';
import { TankType, TreeTypeString } from '../components/Tanks';
import { Tier } from '../core/blitzkrieg/tankopedia';
export type TankopediaSortBy = 'tier' | 'name';
export type TankopediaSortDirection = 'ascending' | 'descending';
@@ -13,6 +14,8 @@ type Tankopedia = {
};
filters: {
tiers: Tier[];
types: TankType[];
treeTypes: TreeTypeString[];
};
};
@@ -25,7 +28,9 @@ export const useTankopedia = create<Tankopedia>()(
direction: 'descending',
},
filters: {
tiers: [...TIERS],
tiers: [],
types: [],
treeTypes: [],
},
}),
{ name: 'tankopedia' },