import { Icon } from './Icon';
import { Surface } from './Surface';
import { Text } from './Text';

export interface SummaryItemProps {
  label: string;
  value: string | number;
  icon: LucideIcon;
  intent?: 'primary' | 'success' | 'warning' | 'critical' | 'telemetry';
  onClick?: () => void;
}

export const SummaryItem = ({ 
  label, 
  value, 
  icon, 
  intent = 'primary',
  onClick 
}: SummaryItemProps) => {
  return (
    <Surface 
      variant="muted" 
      rounded="lg" 
      padding={4} 
      onClick={onClick}
      style={{ cursor: onClick ? 'pointer' : '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>
        <Box>
          <Text size="xs" weight="bold" variant="low" uppercase>
            {label}
          </Text>
          <Text size="lg" weight="bold" variant="high" block marginTop={0.5}>
            {value}
          </Text>
        </Box>
      </Box>
    </Surface>
  );
};
