Enhance StateDisplay component to include 'used' as a loading progress type and adjust progress status and color accordingly.
This commit is contained in:
parent
94c55c8e77
commit
dabad4f489
@ -4,7 +4,13 @@ import { Progress, Flex, Space } from 'antd'
|
|||||||
import StateTag from './StateTag'
|
import StateTag from './StateTag'
|
||||||
|
|
||||||
const StateDisplay = ({ state, showProgress = true, showState = true }) => {
|
const StateDisplay = ({ state, showProgress = true, showState = true }) => {
|
||||||
const loadingProgressTypes = ['loading', 'processing', 'queued', 'printing']
|
const loadingProgressTypes = [
|
||||||
|
'loading',
|
||||||
|
'processing',
|
||||||
|
'queued',
|
||||||
|
'printing',
|
||||||
|
'used'
|
||||||
|
]
|
||||||
const currentState = state || {
|
const currentState = state || {
|
||||||
type: 'unknown',
|
type: 'unknown',
|
||||||
progress: 0
|
progress: 0
|
||||||
@ -23,7 +29,8 @@ const StateDisplay = ({ state, showProgress = true, showState = true }) => {
|
|||||||
currentState?.progress > 0 ? (
|
currentState?.progress > 0 ? (
|
||||||
<Progress
|
<Progress
|
||||||
percent={Math.round(currentState.progress * 100)}
|
percent={Math.round(currentState.progress * 100)}
|
||||||
status='active'
|
status={currentState.type === 'used' ? '' : 'active'}
|
||||||
|
strokeColor={currentState.type === 'used' ? 'orange' : ''}
|
||||||
style={{ width: '150px', marginBottom: '2px' }}
|
style={{ width: '150px', marginBottom: '2px' }}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user