mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: options for ratings tool
This commit is contained in:
1 parent
8cd1a70333
commit
93ffe5c507
5 files changed
+124
-4
No files matched your search
@@ -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',
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
Reference in new issue
Block a user