asb_cloud_front/src/components/ModeDisplay.jsx

27 lines
689 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const modeNames = {
0: "Ручной",
1: "Бурение в роторе",
2: "Проработка",
3: "Бурение в слайде",
4: "Спуск СПО",
5: "Подъем СПО",
6: "Подъем с проработкой",
10: "БЛОКИРОВКА",
}
export const ModeDisplay = (props)=>{
let value = '---'
if(props.data.length > 0){
let lastFullData = props.data[props.data.length - 1]
let index = lastFullData['mode']
if(index >= 0)
value = modeNames[index] ?? index
}
return(<div className="display_header">
<span className="display_label">Режим:</span>
<span className="display_value">{value}</span>
</div>)
}