diff --git a/app/(home-pages)/reader/PreviewDrawer.tsx b/app/(home-pages)/reader/PreviewDrawer.tsx new file mode 100644 index 00000000..e69de29b diff --git a/src/useSelectedPostState.ts b/src/useSelectedPostState.ts new file mode 100644 index 00000000..88b06700 --- /dev/null +++ b/src/useSelectedPostState.ts @@ -0,0 +1,16 @@ +import { create } from "zustand"; +import type { NormalizedDocument } from "src/utils/normalizeRecords"; + +export type SelectedPostListing = { + document_uri: string; + document: NormalizedDocument; + drawer: "quotes" | "comments"; +}; + +export const useSelectedPostListing = create<{ + selectedPostListing: SelectedPostListing | null; + setSelectedPostListing: (post: SelectedPostListing | null) => void; +}>((set) => ({ + selectedPostListing: null, + setSelectedPostListing: (post) => set({ selectedPostListing: post }), +}));