'use client'; import { forwardRef, HTMLAttributes } from 'react'; import styles from './spec-grid.module.css'; export interface SpecItem { label: string; value: string | number; unit?: string; description?: string; icon?: string; highlighted?: boolean; } export interface SpecGridProps extends HTMLAttributes { /** Spec items */ specs: SpecItem[]; /** Color variant */ variant?: 'cyan' | 'green' | 'amber' | 'blood'; /** Grid columns */ columns?: number; /** Show terminal header */ showHeader?: boolean; /** Header title */ headerTitle?: string; /** Compact mode */ compact?: boolean; /** Striped rows */ striped?: boolean; } export const SpecGrid = forwardRef( ( { specs, variant = 'cyan', columns, showHeader = false, headerTitle = 'SYSTEM SPECS', compact = false, striped = false, className, style, ...props }, ref ) => { return (
{showHeader && (
{headerTitle}
)} {specs.map((spec, index) => (
{spec.icon && {spec.icon}}
{spec.label} {spec.value} {spec.unit && {spec.unit}} {spec.description && ( {spec.description} )}
))}
); } ); SpecGrid.displayName = 'SpecGrid'; export default SpecGrid;