updated image loading

This commit is contained in:
2025-08-22 10:38:28 +01:00
parent 44af1b21b7
commit 5ededd8e05
15 changed files with 258 additions and 120 deletions

View File

@@ -29,7 +29,7 @@ export default function SightingHistoryWidget({
className,
}: SightingHistoryWidgetProps) {
useNow(1000);
const { items, selectedRef, setSelectedRef } = useSightingFeedContext();
const { sightings, selectedRef, setSelectedRef } = useSightingFeedContext();
const onRowClick = useCallback(
(ref: number) => {
@@ -39,8 +39,8 @@ export default function SightingHistoryWidget({
);
const rows = useMemo(
() => items.filter(Boolean) as SightingWidgetType[],
[items]
() => sightings?.filter(Boolean) as SightingWidgetType[],
[sightings]
);
return (
@@ -49,7 +49,7 @@ export default function SightingHistoryWidget({
<div className="flex flex-col gap-3 ">
{/* Rows */}
<div className="flex flex-col">
{rows.map((obj, idx) => {
{rows?.map((obj, idx) => {
const isSelected = obj?.ref === selectedRef;
const motionAway = (obj?.motion ?? "").toUpperCase() === "AWAY";
const primaryIsColour = obj?.srcCam === 1;