Learn more about supermemory
diff --git a/apps/web/app/waitlist/page.tsx b/apps/web/app/waitlist/page.tsx
deleted file mode 100644
index c5c2dfd6..00000000
--- a/apps/web/app/waitlist/page.tsx
+++ /dev/null
@@ -1,216 +0,0 @@
-"use client";
-
-import { $fetch } from "@lib/api";
-import { authClient } from "@lib/auth";
-import { useAuth } from "@lib/auth-context";
-import { fetchConsumerProProduct } from "@lib/queries";
-import { Button } from "@ui/components/button";
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@ui/components/card";
-import { useCustomer } from "autumn-js/react";
-import { Clock, LoaderIcon, LogOut, SkipForwardIcon } from "lucide-react";
-import Link from "next/link";
-import { useRouter, useSearchParams } from "next/navigation";
-import { useEffect, useState } from "react";
-import { toast } from "sonner";
-
-export default function WaitlistPage() {
- const router = useRouter();
- const searchParams = useSearchParams();
- const referralCode = searchParams.get("ref");
- const { user } = useAuth();
- const [isChecking, setIsChecking] = useState(true);
- const [isSkippingWaitlist, setIsSkippingWaitlist] = useState(false);
- const [waitlistStatus, setWaitlistStatus] = useState<{
- inWaitlist: boolean;
- accessGranted: boolean;
- createdAt: string;
- } | null>(null);
- const autumn = useCustomer();
-
- const { data: earlyAccess } = fetchConsumerProProduct(autumn);
-
- const handleSkipWaitlist = async () => {
- setIsSkippingWaitlist(true);
- try {
- const res = await autumn.attach({
- productId: "consumer_pro",
- forceCheckout: true,
- successUrl: "https://app.supermemory.ai/",
- });
- if (res.data && "checkout_url" in res.data && res.data.checkout_url) {
- router.push(res.data.checkout_url);
- }
- } catch (error) {
- console.error("Error skipping waitlist:", error);
- } finally {
- setIsSkippingWaitlist(false);
- }
- };
-
- const handleLogout = async () => {
- try {
- await authClient.signOut();
- router.push("/");
- } catch (error) {
- console.error("Error signing out:", error);
- toast.error("Failed to sign out");
- }
- };
-
- useEffect(() => {
- async function checkAccess() {
- if (!user) {
- router.push("/");
- return;
- }
-
- // Anonymous users should sign in first
- if (user.isAnonymous) {
- authClient.signOut();
- router.push("/");
- return;
- }
-
- try {
- // Check waitlist status using the new endpoint
- const response = await $fetch("@get/waitlist/status");
-
- if (response.data) {
- setWaitlistStatus(response.data);
-
- if (!response.data.inWaitlist) {
- authClient.signOut();
- router.push("/login");
- }
-
- // If user has access, redirect to home
- if (response.data.accessGranted) {
- router.push("/");
- }
- }
- } catch (error) {
- console.error("Error checking waitlist status:", error);
- // If there's an error, assume user is on waitlist
- setWaitlistStatus({
- inWaitlist: true,
- accessGranted: false,
- createdAt: new Date().toISOString(),
- });
- } finally {
- setIsChecking(false);
- }
- }
-
- checkAccess();
- }, [user, router]);
-
- if (isChecking) {
- return (
-
-
-
-
Checking access...
-
-
- );
- }
-
- return (
-
-
-
-
-
-
-
- You're on the waitlist!
-
-
- {referralCode
- ? "Thanks for joining through a friend's invitation! You've been added to the waitlist with priority access."
- : "Thanks for your interest in supermemory. We'll notify you as soon as we're ready for you."}
-
- {referralCode && (
-
-
- 🎉 Referred by a friend! You'll get priority access.
-
-
- )}
-
-
-
- {!earlyAccess?.allowed && (
-
- )}
-
-
- We're working hard to bring you the best experience. In the
- meantime, you can:
-