From 1ae274a658d0a705b698a8873c286ec73403b1a6 Mon Sep 17 00:00:00 2001
From: polwex <polwex@sortug.com>
Date: Thu, 15 May 2025 12:17:54 +0700
Subject: m

---
 src/components/Profile.tsx | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 src/components/Profile.tsx

(limited to 'src/components/Profile.tsx')

diff --git a/src/components/Profile.tsx b/src/components/Profile.tsx
new file mode 100644
index 0000000..2ae73e9
--- /dev/null
+++ b/src/components/Profile.tsx
@@ -0,0 +1,36 @@
+"use client";
+
+import { postLogout } from "@/actions/login";
+import { Button } from "@/components/ui/button";
+import {
+  Card,
+  CardHeader,
+  CardDescription,
+  CardContent,
+  CardFooter,
+  CardTitle,
+} from "@/components/ui/card";
+import { Label } from "@/components/ui/label";
+import { Input } from "@/components/ui/input";
+import { useActionState } from "react";
+
+export default function ({ user }: { user: { name: string; id: number } }) {
+  const [state, formAction, isPending] = useActionState(postLogout, 0);
+  return (
+    <form action={formAction}>
+      <Card>
+        <CardHeader>
+          <CardTitle>Profile</CardTitle>
+          {state}
+        </CardHeader>
+        <CardContent>
+          <p>Username: {user.name}</p>
+          <p>User ID: {user.id}</p>
+        </CardContent>
+        <CardFooter>
+          <Button type="submit">Log out</Button>
+        </CardFooter>
+      </Card>
+    </form>
+  );
+}
-- 
cgit v1.2.3

