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 = {
|
||||
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}/>
|
||||
}
|
Loading…
Reference in New Issue
Block a user