"use client";

import styles from "./previewBanner.module.scss";

export function PreviewBanner() {
  return (
    <div className={styles.previewBanner} role="status">
      <span className={styles.label}>Forhåndsvisning</span>
      <button
        type="button"
        className="tertiary"
        onClick={async () => {
          await fetch("/api/preview/disable", { method: "POST" });
          window.location.reload();
        }}
      >
        Avslutt forhåndsvisning
      </button>
    </div>
  );
}
