From 7de09570c0d7907424c30f492207e80ff69e4061 Mon Sep 17 00:00:00 2001
From: polwex <polwex@sortug.com>
Date: Thu, 29 May 2025 15:54:51 +0700
Subject: very pretty

---
 src/pages/logout.tsx | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 src/pages/logout.tsx

(limited to 'src/pages/logout.tsx')

diff --git a/src/pages/logout.tsx b/src/pages/logout.tsx
new file mode 100644
index 0000000..880d175
--- /dev/null
+++ b/src/pages/logout.tsx
@@ -0,0 +1,49 @@
+import { getContextData } from "waku/middleware/context";
+import { useCookies } from "@/lib/server/cookiebridge";
+import { Button } from "@/components/ui/button";
+import { Card } from "@/components/ui/card";
+import Navbar from "@/components/Navbar";
+
+export default async function LogoutPage() {
+  const { user } = getContextData() as any;
+  const loggedIn = !!user;
+
+  // If the user is logged in, delete the cookie
+  if (loggedIn) {
+    const { delCookie } = useCookies();
+    delCookie("sorlang");
+  }
+
+  return (
+    <div className="min-h-screen bg-gray-50">
+      <Navbar user={null} />
+      
+      <div className="container mx-auto py-16 px-4">
+        <Card className="max-w-md mx-auto p-6 text-center">
+          <h1 className="text-2xl font-bold mb-4">
+            {loggedIn ? "You've been logged out" : "Already logged out"}
+          </h1>
+          <p className="text-gray-600 mb-6">
+            {loggedIn 
+              ? "Your session has been ended successfully. Thank you for using Sorlang."
+              : "You were not logged in."}
+          </p>
+          <div className="flex flex-col space-y-4">
+            <Button asChild>
+              <a href="/login">Log back in</a>
+            </Button>
+            <Button variant="outline" asChild>
+              <a href="/">Return to home page</a>
+            </Button>
+          </div>
+        </Card>
+      </div>
+    </div>
+  );
+}
+
+export const getConfig = async () => {
+  return {
+    render: "dynamic",
+  } as const;
+};
\ No newline at end of file
-- 
cgit v1.2.3

