import React from 'react';

interface CardProps {
  children: React.ReactNode;
  title?: React.ReactNode;
  icon?: string;
  extra?: React.ReactNode;
  className?: string;
  bodyClassName?: string;
  noDivider?: boolean;
}

export function Card({
  children,
  title,
  icon,
  extra,
  className = '',
  bodyClassName = '',
  noDivider = true,
}: CardProps) {
  return (
    <div className={`ant-card ${className} bg-white shadow`}>
      {(title || extra) && (
        <div className={`flex justify-between items-center px-5 py-3 ${noDivider ? '' : 'border-b border-gray-100'}`}>
          {title && (
            <div className="card-title !mb-0">
              {icon && <i className={`${icon} mr-2`}></i>}
              <span>{title}</span>
            </div>
          )}
          {extra && (
            <div className="card-extra">
              {extra}
            </div>
          )}
        </div>
      )}
      <div className={`ant-card-body ${bodyClassName}`}>
        {children}
      </div>
    </div>
  );
} 