From e6f2c9f517375952cf9837557908e00224c09740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Fri, 13 Aug 2021 10:31:02 +0500 Subject: [PATCH] use stantart Display component --- src/pages/TelemetryView/ModeDisplay.jsx | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/pages/TelemetryView/ModeDisplay.jsx b/src/pages/TelemetryView/ModeDisplay.jsx index df81db0..a3e020a 100644 --- a/src/pages/TelemetryView/ModeDisplay.jsx +++ b/src/pages/TelemetryView/ModeDisplay.jsx @@ -1,3 +1,5 @@ +import { Display } from '../../components/Display' + const modeNames = { 0: "Ручной", 1: "Бурение в роторе", @@ -11,17 +13,10 @@ const modeNames = { } export const ModeDisplay = ({data})=>{ - let value = '---' + const dataLast = data[data.length - 1] - if(data.length > 0){ - let lastFullData = data[data.length - 1] - let index = lastFullData['mode'] - if(index >= 0) - value = modeNames[index] ?? index - } - - return(
- Режим: - {value} -
) + return } \ No newline at end of file