Replace TitleInteractionProvider context with Jotai atoms

Replaces the 335-line React Context provider with a scoped Jotai store,
giving consumers granular subscriptions and stable handler callbacks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 19:09:57 -05:00
co-authored by Claude Opus 4.6
parent d9b408128b
commit 6a9c9f22c6
8 changed files with 372 additions and 362 deletions
+11
View File
@@ -0,0 +1,11 @@
import { atom } from "jotai";
import type { Season } from "@/lib/types/title";
export const titleIdAtom = atom("");
export const titleTypeAtom = atom<"movie" | "tv">("movie");
export const titleNameAtom = atom("");
export const seasonsAtom = atom<Season[]>([]);
export const userStatusAtom = atom<string | null>(null);
export const userRatingAtom = atom(0);
export const episodeWatchesAtom = atom<string[]>([]);
export const watchingEpAtom = atom<string | null>(null);