"use client"; import { createContext, useContext } from "react"; // Supplies the channel→sites map (channel slug → the ids of the content sites // that expose it) to the chart renderers, so `groupBy: "site"` can fan a video // out to each of its sites. The Archilyzer hub (homepage package) wraps its // dashboard in this provider; the editor and per-site export apps don't, so the // context defaults to null and "site" grouping degrades to channel grouping // there. See chartAggregate.ts (AggregateContext / seriesKeysForStat). export type ChannelSitesMap = Record; const ChannelSitesContext = createContext(null); export function ChannelSitesProvider({ value, children, }: { value: ChannelSitesMap | null; children: React.ReactNode; }) { return ( {children} ); } export function useChannelSites(): ChannelSitesMap | null { return useContext(ChannelSitesContext); }