first commit

This commit is contained in:
ahmadrezabd
2025-11-18 20:22:25 +03:30
commit 948238b6d9
55 changed files with 13772 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { atom } from 'jotai';
import type { User, Session } from '@supabase/supabase-js';
export const sessionAtom = atom<Session | null>(null);
export const userAtom = atom<User | null>((get) => {
const session = get(sessionAtom);
return session?.user ?? null;
});
export const isAuthenticatedAtom = atom<boolean>((get) => {
const session = get(sessionAtom);
return !!session?.user;
});
+11
View File
@@ -0,0 +1,11 @@
import { atom } from 'jotai';
export type Theme = 'light' | 'dark';
// Atom برای مدیریت theme
export const themeAtom = atom<Theme>('light');