import { createContext, useContext } from "react"; type ShareContextValue = { showShareDialog: boolean; sharePeople: string[]; shareSelectedPerson: string; setShareSelectedPerson: React.Dispatch>; shareSelectedDays: number; setShareSelectedDays: React.Dispatch>; shareGenerating: boolean; shareLink: string | null; setShareLink: React.Dispatch>; shareCopied: boolean; setShareCopied: React.Dispatch>; openShareDialog: () => void; generateShareLink: () => Promise; copyShareLink: () => void; closeShareDialog: () => void; resetShareDialogState: () => void; }; const ShareContext = createContext(null); type ShareContextProviderProps = { value: ShareContextValue; children: React.ReactNode; }; export function ShareContextProvider({ value, children }: ShareContextProviderProps) { return {children}; } export function useShareContext(): ShareContextValue { const context = useContext(ShareContext); if (!context) { throw new Error("useShareContext must be used within ShareContextProvider"); } return context; } export type { ShareContextValue };