From 9da178edb6d1eab889c1d01b4d15ad342a594587 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 30 Dec 2025 21:14:44 -0700 Subject: [PATCH] Use empty card with dynamic text for review based on the user's config --- web/public/locales/en/views/events.json | 6 +++- web/src/components/card/EmptyCard.tsx | 11 ++++-- web/src/types/card.ts | 4 +++ web/src/views/events/EventView.tsx | 46 ++++++++++++++++++++----- 4 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 web/src/types/card.ts diff --git a/web/public/locales/en/views/events.json b/web/public/locales/en/views/events.json index 5c0f137b3..ea3ee853d 100644 --- a/web/public/locales/en/views/events.json +++ b/web/public/locales/en/views/events.json @@ -9,7 +9,11 @@ "empty": { "alert": "There are no alerts to review", "detection": "There are no detections to review", - "motion": "No motion data found" + "motion": "No motion data found", + "recordingsDisabled": { + "title": "Recordings must be enabled", + "description": "Review items can only be created for a camera when recordings are enabled for that camera." + } }, "timeline": "Timeline", "timeline.aria": "Select timeline", diff --git a/web/src/components/card/EmptyCard.tsx b/web/src/components/card/EmptyCard.tsx index de934482f..8d6b67a68 100644 --- a/web/src/components/card/EmptyCard.tsx +++ b/web/src/components/card/EmptyCard.tsx @@ -2,15 +2,18 @@ import React from "react"; import { Button } from "../ui/button"; import Heading from "../ui/heading"; import { Link } from "react-router-dom"; +import { cn } from "@/lib/utils"; type EmptyCardProps = { + className?: string; icon: React.ReactNode; title: string; - description: string; + description?: string; buttonText?: string; link?: string; }; export function EmptyCard({ + className, icon, title, description, @@ -18,10 +21,12 @@ export function EmptyCard({ link, }: EmptyCardProps) { return ( -
+
{icon} {title} -
{description}
+ {description && ( +
{description}
+ )} {buttonText?.length && (