Files
Mav-Mobile-UI/src/context/providers/SightingFeedProvider.tsx

43 lines
821 B
TypeScript
Raw Normal View History

2025-08-29 10:07:59 +01:00
import type { ReactNode } from "react";
import { useSightingFeed } from "../../hooks/useSightingFeed";
import { SightingFeedContext } from "../SightingFeedContext";
type SightingFeedProviderProps = {
url: string;
children: ReactNode;
side: string;
};
export const SightingFeedProvider = ({
children,
url,
side,
}: SightingFeedProviderProps) => {
const {
sightings,
selectedRef,
setSelectedRef,
effectiveSelected,
mostRecent,
isPending,
noSighting,
} = useSightingFeed(url);
return (
<SightingFeedContext.Provider
value={{
sightings,
selectedRef,
setSelectedRef,
effectiveSelected,
mostRecent,
side,
isPending,
noSighting,
}}
>
{children}
</SightingFeedContext.Provider>
);
};