import { Typography, Statistic, Card, Col, Progress} from "antd"; const { Text } = Typography; interface ItemProps { title: string, value: string, prefix: JSX.Element, color: string, progress?: boolean, centered: boolean, }; export default function StatisticItem(props: ItemProps) { const { title, value, prefix } = props; const View = props.progress ? ProgressView : StatisticView; const style = props.centered ? {display: 'flex', alignItems: 'center', justifyContent: 'center'} : {}; return (
); } function ProgressView({title, value, prefix, color}) { const endColor = value > 90 ? 'red' : color; const content = (
{prefix}
{title}
{value}%
) return ( content} /> ) } function StatisticView({title, value, prefix, color}) { const valueStyle = { fontSize: "1.8rem" }; return ( ) }