From 84ab7fbd4547d167e528af8e45b519574ff1277e Mon Sep 17 00:00:00 2001 From: Jacobjohnjeevan Date: Wed, 25 Sep 2024 10:09:06 +0530 Subject: [PATCH] Added Assetinfo to Camera Feed - Moved VitalsMonitorAssetPopover to Common (renamed to MonitorAssetPopover, making it a reusable component) - Added className as a prop for styling PopoverPanel - Moved the styling specific to Vitals Popover (position on screen) to the class name - Using the same prop for positioning Popover for Camera feed page - Added Asset information Popover to Camera Feed page --- src/Components/CameraFeed/CameraFeed.tsx | 5 +++++ .../MonitorAssetPopover.tsx} | 22 ++++++++++++------- .../VitalsMonitor/VitalsMonitorFooter.tsx | 7 ++++-- 3 files changed, 24 insertions(+), 10 deletions(-) rename src/Components/{VitalsMonitor/VitalsMonitorAssetPopover.tsx => Common/MonitorAssetPopover.tsx} (82%) diff --git a/src/Components/CameraFeed/CameraFeed.tsx b/src/Components/CameraFeed/CameraFeed.tsx index 863a6bbac8a..832d1f1a10b 100644 --- a/src/Components/CameraFeed/CameraFeed.tsx +++ b/src/Components/CameraFeed/CameraFeed.tsx @@ -12,6 +12,7 @@ import useFullscreen from "../../Common/hooks/useFullscreen"; import useBreakpoints from "../../Common/hooks/useBreakpoints"; import { GetPresetsResponse } from "./routes"; import VideoPlayer from "./videoPlayer"; +import MonitorAssetPopover from "../Common/MonitorAssetPopover"; interface Props { children?: React.ReactNode; @@ -185,6 +186,10 @@ export default function CameraFeed(props: Props) { {props.asset.name} + {!isIOS && (
{ + className, +}: MonitorAssetPopoverProps) => { const { t } = useTranslation(); return ( @@ -35,9 +37,9 @@ const VitalsMonitorAssetPopover = ({ leaveFrom="opacity-100 translate-y-0" leaveTo="opacity-0 translate-y-1" > - +
-
+
{asset?.name}

-

Middleware Hostname:

+

+ Middleware Hostname: +

{asset?.resolved_middleware?.hostname}

-

Local IP Address:

+

+ Local IP Address: +

{asset?.meta?.local_ip_address}

@@ -81,4 +87,4 @@ const VitalsMonitorAssetPopover = ({ ); }; -export default VitalsMonitorAssetPopover; +export default MonitorAssetPopover; diff --git a/src/Components/VitalsMonitor/VitalsMonitorFooter.tsx b/src/Components/VitalsMonitor/VitalsMonitorFooter.tsx index 906495b93b5..1c669cd5bbf 100644 --- a/src/Components/VitalsMonitor/VitalsMonitorFooter.tsx +++ b/src/Components/VitalsMonitor/VitalsMonitorFooter.tsx @@ -1,5 +1,5 @@ import { AssetData } from "../Assets/AssetTypes"; -import VitalsMonitorAssetPopover from "./VitalsMonitorAssetPopover"; +import MonitorAssetPopover from "../Common/MonitorAssetPopover"; interface IVitalsMonitorFooterProps { asset?: AssetData; @@ -9,7 +9,10 @@ const VitalsMonitorFooter = ({ asset }: IVitalsMonitorFooterProps) => { return (

{asset?.name}

- +
); };