Files
fredy/ui/src/components/cards/KpiCard.jsx
Christian Kellner f30ec4645c feat: Fredy UI redesign
* New design :)
2026-04-22 21:11:18 +02:00

35 lines
1.1 KiB
JavaScript

/*
* Copyright (c) 2026 by Christian Kellner.
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
*/
import { Card, Typography, Space } from '@douyinfe/semi-ui-19';
import './DashboardCard.less';
export default function KpiCard({ title, icon, value, description, color = 'gray', children }) {
const { Text } = Typography;
return (
<Card className={`dashboard-card ${color}`} bodyStyle={{ padding: '16px' }}>
<Space vertical align="start" spacing="tight" style={{ width: '100%' }}>
<Space>
<div className="dashboard-card__icon">{icon}</div>
<Text strong className="dashboard-card__title">
{title}
</Text>
</Space>
<div className="dashboard-card__content">
<div className="dashboard-card__value">
{value}
{children}
</div>
{description && (
<Text size="small" className="dashboard-card__desc">
{description}
</Text>
)}
</div>
</Space>
</Card>
);
}