import { atom } from 'jotai'; import type { User, Session } from '@supabase/supabase-js'; export const sessionAtom = atom(null); export const userAtom = atom((get) => { const session = get(sessionAtom); return session?.user ?? null; }); export const isAuthenticatedAtom = atom((get) => { const session = get(sessionAtom); return !!session?.user; });