import type { ReactNode } from 'react';
import type { LucideIcon } from 'lucide-react';

import { cn } from '@/lib/utils';

interface ModuleHeaderProps {
  readonly title: ReactNode;
  readonly description?: ReactNode;
  readonly icon: LucideIcon;
  readonly iconClassName: string;
  readonly iconShadowClassName?: string;
  readonly className?: string;
  readonly titleClassName?: string;
  readonly descriptionClassName?: string;
}

export function ModuleHeader({
  title,
  description,
  icon: Icon,
  iconClassName,
  iconShadowClassName,
  className,
  titleClassName,
  descriptionClassName,
}: ModuleHeaderProps) {
  return (
    <div className={className}>
      <h2 className={cn('text-2xl font-bold text-white flex items-center gap-3', titleClassName)}>
        <span
          className={cn(
            'w-10 h-10 rounded-xl flex items-center justify-center shadow-lg',
            iconClassName,
            iconShadowClassName,
          )}
        >
          <Icon size={20} className="text-white" />
        </span>
        {title}
      </h2>
      {description && (
        <p className={cn('text-sm text-slate-400 mt-1', descriptionClassName)}>
          {description}
        </p>
      )}
    </div>
  );
}
