From 25a744bd8d70bb3945c7237e3eb69540501dc855 Mon Sep 17 00:00:00 2001 From: Toba Ojo Date: Fri, 21 Nov 2025 08:55:23 +0000 Subject: [PATCH] addind dashboard features will come back to finish --- index.html | 4 ++-- .../dashboard/components/CameraStatus.tsx | 19 +++++++++++++++++++ .../dashboard/components/DashboardGrid.tsx | 5 ++++- .../dashboard/components/SystemStatusCard.tsx | 2 +- src/types/types.ts | 2 ++ src/ui/CardHeader.tsx | 8 ++++++-- src/ui/StatusIndicators.tsx | 9 +++++++++ 7 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 src/ui/StatusIndicators.tsx diff --git a/index.html b/index.html index fd0bb43..aec7947 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,10 @@ - + - MAV | BayiQ + BayIQ
diff --git a/src/features/dashboard/components/CameraStatus.tsx b/src/features/dashboard/components/CameraStatus.tsx index e69de29..47cb2d6 100644 --- a/src/features/dashboard/components/CameraStatus.tsx +++ b/src/features/dashboard/components/CameraStatus.tsx @@ -0,0 +1,19 @@ +import Card from "../../../ui/Card"; +import CardHeader from "../../../ui/CardHeader"; + +type CameraStatusProps = { + title: string; + status?: string; + description: string; +}; + +const CameraStatus = ({ title, status, description }: CameraStatusProps) => { + return ( + + +

{description}

+
+ ); +}; + +export default CameraStatus; diff --git a/src/features/dashboard/components/DashboardGrid.tsx b/src/features/dashboard/components/DashboardGrid.tsx index 8cf481c..3e52ec0 100644 --- a/src/features/dashboard/components/DashboardGrid.tsx +++ b/src/features/dashboard/components/DashboardGrid.tsx @@ -1,9 +1,12 @@ +import CameraStatus from "./CameraStatus"; import SystemStatusCard from "./SystemStatusCard"; const DashboardGrid = () => { return ( -
+
+ +
); }; diff --git a/src/features/dashboard/components/SystemStatusCard.tsx b/src/features/dashboard/components/SystemStatusCard.tsx index b887e7e..7d842e9 100644 --- a/src/features/dashboard/components/SystemStatusCard.tsx +++ b/src/features/dashboard/components/SystemStatusCard.tsx @@ -11,7 +11,7 @@ const SystemStatusCard = () => { {stats ? ( <>
UTC: {stats["system-clock-utc"]}
- Local: {stats["system-clock-local"]} +
Local: {stats["system-clock-local"]}
CPU: {stats["memory-cpu-status"]} Threads: {stats["thread-count"]} diff --git a/src/types/types.ts b/src/types/types.ts index bc491f9..3c59478 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -10,3 +10,5 @@ export type InfoBarData = { "memory-cpu-status": string; "thread-count": string; }; + +export type StatusIndicator = "neutral-quaternary" | "dark" | "info" | "success" | "warning" | "danger"; diff --git a/src/ui/CardHeader.tsx b/src/ui/CardHeader.tsx index 027ecae..25da205 100644 --- a/src/ui/CardHeader.tsx +++ b/src/ui/CardHeader.tsx @@ -1,17 +1,21 @@ import clsx from "clsx"; +import StatusIndicators from "./StatusIndicators"; type CameraOverviewHeaderProps = { title?: string; + status?: string; }; -const CardHeader = ({ title }: CameraOverviewHeaderProps) => { +const CardHeader = ({ title, status }: CameraOverviewHeaderProps) => { + console.log(status); return (
-
+
{/* {icon && } */} + {status && }

{title}

diff --git a/src/ui/StatusIndicators.tsx b/src/ui/StatusIndicators.tsx new file mode 100644 index 0000000..5d4d529 --- /dev/null +++ b/src/ui/StatusIndicators.tsx @@ -0,0 +1,9 @@ +import clsx from "clsx"; + +type StatusIndicatorsProps = { status: string }; + +const StatusIndicators = ({ status }: StatusIndicatorsProps) => { + return ; +}; + +export default StatusIndicators;