import React from 'react';
import { Plus } from 'lucide-react';

const SectionHeader = ({
  icon: Icon,
  discountStyle = false,
  title,
  description,
  button = false,
  buttonOpeningModal = false,
  onClick = null,
  secondaryButton = null,
}) => {
  return (
    <div className="flex items-center justify-between mb-6">
      <div className="flex items-center space-x-4">
        <div
          className={`${discountStyle ? 'bg-yellow-100' : 'bg-primary/10'} p-3 rounded-full shadow-sm`}
        >
          <Icon
            className={
              discountStyle
                ? 'w-8 h-8 text-yellow-600'
                : 'w-8 h-8 text-primary'
            }
          />
        </div>
        <div>
          <h2 className="font-headline text-2xl font-bold text-gray-800">{title}</h2>
          <p className="text-sm text-gray-500 italic">{description}</p>
        </div>
      </div>
      <div className="flex items-center gap-2">
        {secondaryButton}
        {button && onClick && (
          <button
            onClick={onClick}
            className={
              buttonOpeningModal
                ? 'flex items-center bg-primary/10 text-primary p-2 rounded-full shadow-sm hover:bg-primary/20 min-h-[44px] min-w-[44px] justify-center transition-colors'
                : 'text-primary hover:bg-primary/10 rounded-full p-2 min-h-[44px] min-w-[44px] flex items-center justify-center transition-colors'
            }
          >
            <Plus className="w-6 h-6" />
          </button>
        )}
      </div>
    </div>
  );
};

export default SectionHeader;
