use stantart Display component

This commit is contained in:
Фролов 2021-08-13 10:31:02 +05:00
parent 0a1af2c293
commit e6f2c9f517

View File

@ -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(<div className="display_header">
<span className="display_label">Режим:</span>
<span className="display_value">{value}</span>
</div>)
return <Display className='border_small display_flex_container user_card'
label='Режим:'
value={dataLast?.mode}
enumeration={modeNames}/>
}