File size: 966 Bytes
d54a751
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use client';

/**
 * Flat, near-opaque card for scientific output (charts, trees, scores).
 * No blur, no tint, no extrusion — translucency hurts data readability.
 */

interface DataCardProps {
  title?: string;
  subtitle?: string;
  actions?: React.ReactNode;
  children: React.ReactNode;
  className?: string;
}

export function DataCard({ title, subtitle, actions, children, className = '' }: DataCardProps) {
  return (
    <section className={`data-card p-5 ${className}`}>
      {(title || actions) && (
        <header className="mb-4 flex items-center justify-between gap-3">
          <div>
            {title && (
              <h2 className="text-base font-semibold tracking-tight text-text-primary">
                {title}
              </h2>
            )}
            {subtitle && <p className="mt-0.5 text-xs text-text-muted">{subtitle}</p>}
          </div>
          {actions}
        </header>
      )}
      {children}
    </section>
  );
}