import { createContext, useContext } from "react"; import type { FeedView } from "../lib/feedView"; // The feed view-mode contexts + hooks, split out of FeedViewProvider so that file exports only // components (Fast Refresh). export interface FeedViewActions { setView: (v: FeedView) => void; } export const FeedViewStateContext = createContext("cards"); export const FeedViewActionsContext = createContext({ setView: () => {} }); export function useFeedView(): FeedView { return useContext(FeedViewStateContext); } export function useFeedViewActions(): FeedViewActions { return useContext(FeedViewActionsContext); }