|
|
|
@ -7,16 +7,18 @@ interface ItemProps { |
|
|
|
prefix: JSX.Element, |
|
|
|
prefix: JSX.Element, |
|
|
|
color: string, |
|
|
|
color: string, |
|
|
|
progress?: boolean, |
|
|
|
progress?: boolean, |
|
|
|
|
|
|
|
centered: boolean, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default function StatisticItem(props: ItemProps) { |
|
|
|
export default function StatisticItem(props: ItemProps) { |
|
|
|
const { title, value, prefix } = props; |
|
|
|
const { title, value, prefix } = props; |
|
|
|
const View = props.progress ? ProgressView : StatisticView; |
|
|
|
const View = props.progress ? ProgressView : StatisticView; |
|
|
|
|
|
|
|
const style = props.centered ? {display: 'flex', alignItems: 'center', justifyContent: 'center'} : {}; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Col span={8}> |
|
|
|
<Col span={8}> |
|
|
|
<Card> |
|
|
|
<Card> |
|
|
|
<div style={{display: 'flex', alignItems: 'center', justifyContent: 'center'}}> |
|
|
|
<div style={style}> |
|
|
|
<View {...props} /> |
|
|
|
<View {...props} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</Card> |
|
|
|
</Card> |
|
|
|
|