You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
589 B
20 lines
589 B
2 weeks ago
|
import { create } from "zustand";
|
||
|
|
||
|
type GlobalState = {
|
||
|
country: string;
|
||
|
language: string;
|
||
|
currency: string;
|
||
|
setGlobalCountry: (region: { country: string }) => void;
|
||
|
setGlobalLanguage: (language: { language: string }) => void;
|
||
|
setGlobalCurrency: (currency: { currency: string }) => void;
|
||
|
};
|
||
|
|
||
|
export const useGlobalStore = create<GlobalState>((set) => ({
|
||
|
country: "",
|
||
|
language: "",
|
||
|
currency: "",
|
||
|
setGlobalCountry: ({ country }) => set({ country }),
|
||
|
setGlobalLanguage: ({ language }) => set({ language }),
|
||
|
setGlobalCurrency: ({ currency }) => set({ currency }),
|
||
|
}));
|