import React from 'react';
import { Text } from '@/ui/Text';
import { Grid } from '@/ui/Grid';
import { Stack } from '@/ui/Stack';

interface KpiItem {
  label: string;
  value: string | number;
  color?: string;
}

interface DashboardKpiRowProps {
  items: KpiItem[];
}

/**
 * DashboardKpiRow
 * 
 * A horizontal row of key performance indicators with telemetry styling.
 * Uses UI primitives to comply with architectural constraints.
 */
export function DashboardKpiRow({ items }: DashboardKpiRowProps) {
  return (
    <Grid responsiveGridCols={{ base: 2, md: 3, lg: 6 }} gap={4}>
      {items.map((item, index) => (
        <Stack key={index} borderLeft pl={4} borderColor="var(--color-outline)">
          <Text 
            size="xs" 
            weight="bold" 
            uppercase 
            letterSpacing="tighter" 
            color="var(--color-text-low)"
            block
          >
            {item.label}
          </Text>
          <Text 
            size="xl" 
            font="mono" 
            weight="bold"
            color={item.color || 'var(--color-text-high)'}
          >
            {item.value}
          </Text>
        </Stack>
      ))}
    </Grid>
  );
}
