feat: options for ratings tool

This commit is contained in:
TrèsAbhi committed 2023-10-29 13:40:32 -05:00
1 parent 8cd1a70333
commit 93ffe5c507
5 files changed
+124 -4

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
import { Region } from '../constants/regions';
export type RatingsType = 'neighbors' | 'league';
interface Ratings {
type: RatingsType;
/**
* When null, the current season is used unless there ain't one in which case
* we do whatever lol
*/
season: number | null;
region: Region;
league: number;
}
export const useRatings = create<Ratings>()(
devtools(
persist(
(set) => ({
type: 'league',
season: null,
league: 0,
region: 'com',
}),
{
name: 'ratings',
},
),
),
);