mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-05-06 05:38:51 +00:00
✨ login page
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { MainStore, User } from '@/types'
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
|
||||
export const useMainStore = create<MainStore, [['zustand/persist', MainStore]]>(
|
||||
persist(
|
||||
(set, get) => ({
|
||||
profile: get()?.profile,
|
||||
setProfile: (profile: User | undefined) => set({ profile }),
|
||||
}),
|
||||
{
|
||||
name: 'mainStore',
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
},
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user