diff --git a/components/preview-suspense.tsx b/components/preview-suspense.tsx deleted file mode 100644 index a0acc97e0..000000000 --- a/components/preview-suspense.tsx +++ /dev/null @@ -1,4 +0,0 @@ -'use client'; - -// Once rollup supports 'use client' module directives then 'next-sanity' will include them and this re-export will no longer be necessary -export { PreviewSuspense as default } from 'next-sanity/preview'; diff --git a/lib/sanity/sanity.preview.ts b/lib/sanity/sanity.preview.ts deleted file mode 100644 index 75dc1c8dd..000000000 --- a/lib/sanity/sanity.preview.ts +++ /dev/null @@ -1,20 +0,0 @@ -"use client"; - -import { definePreview } from "next-sanity/preview"; -import { dataset, projectId } from "./sanity.client"; - -function onPublicAccessOnly() { - throw new Error("Unable to load preview as you're not logged in"); -} - -if (!projectId || !dataset) { - throw new Error( - "Missing projectId or dataset. Check your sanity.json or .env" - ); -} - -export const usePreview = definePreview({ - projectId, - dataset, - onPublicAccessOnly, -}); \ No newline at end of file