38 lines
994 B
TypeScript
38 lines
994 B
TypeScript
import { LucideIcon } from 'lucide-react';
|
|
import { Box } from './Box';
|
|
import { Card } from './Card';
|
|
import { Icon } from './Icon';
|
|
import { Text } from './Text';
|
|
|
|
export interface HorizontalStatCardProps {
|
|
label: string;
|
|
value: string | number;
|
|
icon: LucideIcon;
|
|
intent?: 'primary' | 'success' | 'warning' | 'critical' | 'telemetry';
|
|
}
|
|
|
|
export const HorizontalStatCard = ({
|
|
label,
|
|
value,
|
|
icon,
|
|
intent = 'primary'
|
|
}: HorizontalStatCardProps) => {
|
|
return (
|
|
<Card variant="default">
|
|
<Box display="flex" alignItems="center" gap={4}>
|
|
<Box padding={3} rounded="lg" bg="var(--ui-color-bg-surface-muted)">
|
|
<Icon icon={icon} size={5} intent={intent} />
|
|
</Box>
|
|
<Box>
|
|
<Text size="xs" weight="bold" variant="low" uppercase>
|
|
{label}
|
|
</Text>
|
|
<Text size="xl" weight="bold" variant="high" block marginTop={0.5}>
|
|
{value}
|
|
</Text>
|
|
</Box>
|
|
</Box>
|
|
</Card>
|
|
);
|
|
};
|