function Header({ onOpenConfig, onToggleHistory, historyCount, historyOpen }) {
  return (
    <header className="pv-header" data-screen-label="Header">
      <div className="pv-header-inner">
        <div className="pv-title">
          <img className="wordmark" src="assets/wordmark.svg" alt="policy/viewer" />
          <span className="pv-version">v{VERSION}</span>
        </div>
        <div style={{ flex: 1 }} />
        <button
          className={cx("pv-icon-btn", historyOpen && "is-active")}
          onClick={onToggleHistory}
          aria-label="History"
          title="History"
        >
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
            <path d="M3 12a9 9 0 1 0 3-6.7L3 8" />
            <polyline points="3 4 3 8 7 8" />
            <polyline points="12 7 12 12 15 14" />
          </svg>
          <span>History</span>
          {historyCount > 0 && <span className="pv-icon-btn-count">{historyCount}</span>}
        </button>
        <button
          className="pv-icon-btn"
          onClick={onOpenConfig}
          aria-label="Config"
          title="Config"
        >
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
            <circle cx="12" cy="12" r="3" />
            <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
          </svg>
          <span>Config</span>
        </button>
      </div>
    </header>
  );
}

Object.assign(window, { Header });
