type PageHeaderProps = {
  title: string;
  onBack?: () => void;
  backLabel?: string;
  right?: React.ReactNode;
};

export default function PageHeader({ title, onBack, backLabel = '←', right }: PageHeaderProps) {
  return (
    <header className="page-header">
      <div className="page-header-side">
        {onBack ? (
          <button type="button" className="back-btn" onClick={onBack} aria-label="返回">
            {backLabel}
          </button>
        ) : (
          <span className="page-header-spacer" />
        )}
      </div>
      <div className="app-page-title page-header-title">{title}</div>
      <div className="page-header-side page-header-side--right">{right ?? <span className="page-header-spacer" />}</div>
    </header>
  );
}
