diff --git a/web/src/components/card/AnimatedEventCard.tsx b/web/src/components/card/AnimatedEventCard.tsx index a032ecda6f..acacf47077 100644 --- a/web/src/components/card/AnimatedEventCard.tsx +++ b/web/src/components/card/AnimatedEventCard.tsx @@ -14,8 +14,12 @@ import { baseUrl } from "@/api/baseUrl"; type AnimatedEventCardProps = { event: ReviewSegment; + selectedGroup?: string; }; -export function AnimatedEventCard({ event }: AnimatedEventCardProps) { +export function AnimatedEventCard({ + event, + selectedGroup, +}: AnimatedEventCardProps) { const { data: config } = useSWR("config"); const currentHour = useMemo(() => isCurrentHour(event.start_time), [event]); @@ -53,7 +57,8 @@ export function AnimatedEventCard({ event }: AnimatedEventCardProps) { const navigate = useNavigate(); const onOpenReview = useCallback(() => { - navigate("review", { + const url = selectedGroup ? `review?group=${selectedGroup}` : "review"; + navigate(url, { state: { severity: event.severity, recording: { @@ -64,7 +69,7 @@ export function AnimatedEventCard({ event }: AnimatedEventCardProps) { }, }); axios.post(`reviews/viewed`, { ids: [event.id] }); - }, [navigate, event]); + }, [navigate, selectedGroup, event]); // image behavior diff --git a/web/src/pages/Events.tsx b/web/src/pages/Events.tsx index 8c9debc64e..be7e253a83 100644 --- a/web/src/pages/Events.tsx +++ b/web/src/pages/Events.tsx @@ -68,6 +68,19 @@ export default function Events() { const [reviewFilter, setReviewFilter, reviewSearchParams] = useApiFilter(); + useSearchEffect("group", (reviewGroup) => { + if (config && reviewGroup) { + const group = config.camera_groups[reviewGroup]; + + if (group) { + setReviewFilter({ + ...reviewFilter, + cameras: group.cameras, + }); + } + } + }); + const onUpdateFilter = useCallback( (newFilter: ReviewFilter) => { setReviewFilter(newFilter); diff --git a/web/src/views/live/LiveDashboardView.tsx b/web/src/views/live/LiveDashboardView.tsx index fe61c45c0f..6e847036ec 100644 --- a/web/src/views/live/LiveDashboardView.tsx +++ b/web/src/views/live/LiveDashboardView.tsx @@ -224,7 +224,13 @@ export default function LiveDashboardView({
{events.map((event) => { - return ; + return ( + + ); })}