diff --git a/app/(root)/unsubscribe/page.tsx b/app/(root)/unsubscribe/page.tsx index d3798d5..1c90b0c 100644 --- a/app/(root)/unsubscribe/page.tsx +++ b/app/(root)/unsubscribe/page.tsx @@ -1,14 +1,12 @@ "use client"; import Newsletter from "@/components/shared/Newsletter"; -import React, { useState } from "react"; +import React, { Suspense, useState } from "react"; import { ReadonlyURLSearchParams, useSearchParams } from "next/navigation"; import { Button } from "@/components/ui/button"; import { useToast } from "@/components/ui/use-toast"; import HCaptcha from "@hcaptcha/react-hcaptcha"; -const UnsubscribePage = (props: { - searchParams: Promise<{ id: string | undefined }>; -}) => { +const UnsubscribeForm = () => { const searchParams = useSearchParams() as ReadonlyURLSearchParams; const unsubscribeId = searchParams.has("id") ? searchParams.get("id") @@ -56,6 +54,35 @@ const UnsubscribePage = (props: { } }; + return ( +
{ + e.preventDefault(); + setShowCaptcha(true); + }} + > + + {showCaptcha && ( + + )} + + ); +}; + +const UnsubscribePage = () => { return (
-
{ - e.preventDefault(); - setShowCaptcha(true); - }} + + Loading unsubscription form... +

+ } > - - {showCaptcha && ( - - )} - + +
); };