forked from ddrilling/asb_cloud_front
use stantart Display component
This commit is contained in:
parent
0a1af2c293
commit
e6f2c9f517
@ -1,3 +1,5 @@
|
|||||||
|
import { Display } from '../../components/Display'
|
||||||
|
|
||||||
const modeNames = {
|
const modeNames = {
|
||||||
0: "Ручной",
|
0: "Ручной",
|
||||||
1: "Бурение в роторе",
|
1: "Бурение в роторе",
|
||||||
@ -11,17 +13,10 @@ const modeNames = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ModeDisplay = ({data})=>{
|
export const ModeDisplay = ({data})=>{
|
||||||
let value = '---'
|
const dataLast = data[data.length - 1]
|
||||||
|
|
||||||
if(data.length > 0){
|
return <Display className='border_small display_flex_container user_card'
|
||||||
let lastFullData = data[data.length - 1]
|
label='Режим:'
|
||||||
let index = lastFullData['mode']
|
value={dataLast?.mode}
|
||||||
if(index >= 0)
|
enumeration={modeNames}/>
|
||||||
value = modeNames[index] ?? index
|
|
||||||
}
|
|
||||||
|
|
||||||
return(<div className="display_header">
|
|
||||||
<span className="display_label">Режим:</span>
|
|
||||||
<span className="display_value">{value}</span>
|
|
||||||
</div>)
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user