File size: 426 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"use client";
import styles from "./PreviewNotice.module.css";
import { usePathname } from "next/navigation";

export const PreviewNotice = () => {
  const pathname = usePathname();

  return (
    <aside className={styles.preview}>
      Preview mode enabled
      <a
        className={styles.link}
        href={`/api/exit-preview?path=${encodeURIComponent(pathname)}`}
      >
        Exit
      </a>
    </aside>
  );
};