From be0f537dc4fe384eef09436833c6407e6482c16d Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Thu, 9 Nov 2023 15:40:16 +0700
Subject: Initial commit

---
 src/modules/profile-card/components/Dropdown.tsx | 36 ++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 src/modules/profile-card/components/Dropdown.tsx

(limited to 'src/modules/profile-card/components/Dropdown.tsx')

diff --git a/src/modules/profile-card/components/Dropdown.tsx b/src/modules/profile-card/components/Dropdown.tsx
new file mode 100644
index 0000000..f6f58c9
--- /dev/null
+++ b/src/modules/profile-card/components/Dropdown.tsx
@@ -0,0 +1,36 @@
+"use client";
+import { DropdownItem, DropdownMenu, DropdownTrigger, Dropdown as UIDropdown } from "@nextui-org/react"
+import { MoreVerticalIcon } from "lucide-react"
+import { deleteCookie } from "cookies-next"
+import { useRouter } from "next/navigation";
+
+const Dropdown = () => {
+  const router = useRouter()
+
+  const logout = () => {
+    deleteCookie('credential')
+    router.push('/login')
+  }
+
+  return (
+    <UIDropdown>
+      <DropdownTrigger>
+        <button type="button" className="p-1">
+          <MoreVerticalIcon size={20} />
+        </button>
+      </DropdownTrigger>
+      <DropdownMenu>
+        <DropdownItem
+          key="logout"
+          className="text-danger-600"
+          color="danger"
+          onPress={logout}
+        >
+          Logout
+        </DropdownItem>
+      </DropdownMenu>
+    </UIDropdown>
+  )
+}
+
+export default Dropdown
\ No newline at end of file
-- 
cgit v1.2.3

