website refactor

This commit is contained in:
2026-01-19 12:35:16 +01:00
parent a8731e6937
commit 15290400b3
122 changed files with 902 additions and 255 deletions

View File

@@ -1,12 +1,14 @@
import { LucideIcon } from 'lucide-react';
import React from 'react';
import { Box } from './Box';
import { Icon } from './Icon';
import { Text } from './Text';
import { Stack } from './Stack';
export interface StatGridItemProps {
label: string;
value: string | number;
icon?: React.ReactNode;
icon?: React.ReactNode | LucideIcon;
intent?: 'primary' | 'success' | 'warning' | 'critical' | 'high' | 'med' | 'low';
color?: string; // Alias for intent
}
@@ -18,11 +20,17 @@ export const StatGridItem = ({
intent = 'high',
color
}: StatGridItemProps) => {
const isLucideIcon = typeof icon === 'function' || (typeof icon === 'object' && icon !== null && 'render' in icon);
return (
<Box padding={4} textAlign="center">
{icon && (
<Stack direction="row" align="center" justify="center" gap={2} marginBottom={1}>
{icon}
{isLucideIcon ? (
<Icon icon={icon as LucideIcon} size={4} intent={intent} />
) : (
icon
)}
</Stack>
)}
<Text size="2xl" weight="bold" variant={intent} color={color} block>