import React from 'react';

interface PageHeaderProps {
  title: string;
  illustration?: React.ReactNode;
}

/**
 * Displays a centered header with a title and an optional illustration.
 * Defaults to showing the Learnitive mark as the illustration.
 * This component now incorporates the logic from the previous IllustratedPageHeader.
 */
export function PageHeader({ title, illustration }: PageHeaderProps) {
  const illustrationContent = illustration ?? (
    <img
      src="/web-app-manifest-192x192.png"
      alt={t.app.common.learnitiveLogoAlt}
      className="h-28 w-28 opacity-40 grayscale"
    />
  );

  return (
    <div className="flex flex-col items-center justify-center gap-4 text-center">
      <div className="mb-4 flex justify-center opacity-40">
        {illustrationContent}
      </div>
      <h2 className="font-semibold text-xl tracking-widest">{title}</h2>
    </div>
  );
}
