mirror of
https://github.com/Mail-0/Zero.git
synced 2026-07-01 08:16:28 +00:00
14 lines
360 B
TypeScript
14 lines
360 B
TypeScript
import { atomWithStorage } from "jotai/utils";
|
|
import { atom } from "jotai";
|
|
|
|
export interface DraftType {
|
|
id: string;
|
|
recipient?: string;
|
|
cc?: string;
|
|
bcc?: string;
|
|
subject?: string;
|
|
message?: string;
|
|
}
|
|
export const draftsAtom = atomWithStorage<DraftType[]>("emailDrafts", []);
|
|
export const draftCountAtom = atom((get) => get(draftsAtom).length);
|