From 0eec8336e55d015148879c432c92d6337517db22 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Wed, 21 Jun 2023 11:29:55 +0530 Subject: [PATCH] Tailwind `LiveFeed.tsx` (#5718) * fixes #4966 * fixes #4966 --- .../Facility/Consultations/LiveFeed.tsx | 168 ++++++------------ 1 file changed, 57 insertions(+), 111 deletions(-) diff --git a/src/Components/Facility/Consultations/LiveFeed.tsx b/src/Components/Facility/Consultations/LiveFeed.tsx index 7db5bb2dfbb..84734b2a8f8 100644 --- a/src/Components/Facility/Consultations/LiveFeed.tsx +++ b/src/Components/Facility/Consultations/LiveFeed.tsx @@ -1,9 +1,7 @@ -/* eslint-disable eqeqeq */ import { useEffect, useState, useRef } from "react"; import { useDispatch } from "react-redux"; import screenfull from "screenfull"; import useKeyboardShortcut from "use-keyboard-shortcut"; -import loadable from "@loadable/component"; import { listAssetBeds, partialUpdateAssetBed, @@ -15,23 +13,16 @@ import { useMSEMediaPlayer, } from "../../../Common/hooks/useMSEplayer"; import { useFeedPTZ } from "../../../Common/hooks/useFeedPTZ"; -const PageTitle = loadable(() => import("../../Common/PageTitle")); import * as Notification from "../../../Utils/Notifications.js"; -import { - Card, - CardContent, - InputLabel, - Modal, - Tooltip, -} from "@material-ui/core"; import { FeedCameraPTZHelpButton } from "./Feed"; import { AxiosError } from "axios"; -import { isNull } from "lodash"; import { BedSelect } from "../../Common/BedSelect"; import { BedModel } from "../models"; -import { LegacyTextInputField } from "../../Common/HelperInputFields"; import useWindowDimensions from "../../../Common/hooks/useWindowDimensions"; import CareIcon from "../../../CAREUI/icons/CareIcon"; +import Page from "../../Common/components/Page"; +import ConfirmDialogV2 from "../../Common/ConfirmDialogV2"; +import { FieldLabel } from "../../Form/FormFields/FormField"; const LiveFeed = (props: any) => { const middlewareHostname = @@ -294,85 +285,50 @@ const LiveFeed = (props: any) => { } return ( -
- - + {toDelete && ( - - - -
- Confirm delete preset: {toDelete.meta.preset_name} (in bed:{" "} - {toDelete.bed_object.name})? -
-
-
- - -
-
-
-
+ +

+ Preset: {toDelete.meta.preset_name} +

+

+ Bed: {toDelete.bed_object.name} +

+ + } + action="Delete" + variant="danger" + onClose={() => setToDelete(null)} + onConfirm={() => deletePreset(toDelete.id)} + /> )} {toUpdate && ( - setToUpdate(null)} + onConfirm={() => updatePreset(toUpdate)} > - - -
Update Preset
-
-
- Bed - setBed(selected as BedModel)} - selected={bed} - error="" - multiple={false} - location={cameraAsset.location_id} - facility={cameraAsset.facility_id} - /> -
-
- Preset Name - setNewPreset(e.target.value)} - errors="" - /> -
- -
- - -
-
-
-
+
+ Bed + setBed(selected as BedModel)} + selected={bed} + error="" + multiple={false} + location={cameraAsset.location_id} + facility={cameraAsset.facility_id} + /> +
+
)}
@@ -451,30 +407,20 @@ const LiveFeed = (props: any) => { .replace("ArrowRight", "→"); return ( - - {`${option.label} (${shortcutKeyDescription})`} - - } - key={option.action} + - + {option.label} + {option.icon ? ( + + ) : ( + + {option.value}x + + )} + {`${option.label} (${shortcutKeyDescription})`} + ); })}
@@ -644,7 +590,7 @@ const LiveFeed = (props: any) => {
-
+ ); };