import type { ReactNode } from 'react';

interface CardProps {
  icon?: string;
  title?: ReactNode;
  headerRight?: ReactNode;
  children: ReactNode;
  className?: string;
}

export function Card({ icon, title, headerRight, children, className = '' }: CardProps) {
  return (
    <div className={`card ${className}`}>
      {(icon || title) && (
        <div className="card-header">
          {icon && <span className="material-symbols-outlined">{icon}</span>}
          {title && <span className="card-title">{title}</span>}
          {headerRight && <div style={{ marginLeft: 'auto' }}>{headerRight}</div>}
        </div>
      )}
      <div className="card-body">{children}</div>
    </div>
  );
}
