website refactor
This commit is contained in:
@@ -1,30 +1,38 @@
|
||||
import React from 'react';
|
||||
import { LucideIcon } from 'lucide-react';
|
||||
import { Stack } from './primitives/Stack';
|
||||
import { Surface } from './primitives/Surface';
|
||||
import { Box } from './primitives/Box';
|
||||
import { Text } from './Text';
|
||||
import { Icon } from './Icon';
|
||||
import { Surface } from './primitives/Surface';
|
||||
import { LucideIcon } from 'lucide-react';
|
||||
|
||||
interface StatBoxProps {
|
||||
icon: LucideIcon;
|
||||
export interface StatBoxProps {
|
||||
label: string;
|
||||
value: string | number;
|
||||
color?: string;
|
||||
icon: LucideIcon;
|
||||
intent?: 'primary' | 'success' | 'warning' | 'critical' | 'telemetry';
|
||||
}
|
||||
|
||||
export function StatBox({ icon, label, value, color = 'text-primary-blue' }: StatBoxProps) {
|
||||
export const StatBox = ({
|
||||
label,
|
||||
value,
|
||||
icon,
|
||||
intent = 'primary'
|
||||
}: StatBoxProps) => {
|
||||
return (
|
||||
<Surface variant="muted" rounded="xl" border padding={4}>
|
||||
<Stack direction="row" align="center" gap={3}>
|
||||
<Surface variant="muted" rounded="lg" padding={2}>
|
||||
<Icon icon={icon} size={5} color={color} />
|
||||
</Surface>
|
||||
<Box>
|
||||
<Text size="2xl" weight="bold" color="text-white" block>{value}</Text>
|
||||
<Text size="xs" color="text-gray-500" block>{label}</Text>
|
||||
<Surface variant="muted" rounded="xl" padding={4} style={{ border: '1px solid var(--ui-color-border-default)' }}>
|
||||
<Box display="flex" alignItems="center" gap={4}>
|
||||
<Box padding={2} rounded="lg" bg="var(--ui-color-bg-surface-muted)">
|
||||
<Icon icon={icon} size={5} intent={intent} />
|
||||
</Box>
|
||||
</Stack>
|
||||
<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>
|
||||
</Surface>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user