25 lines
745 B
TypeScript
25 lines
745 B
TypeScript
"use client";
|
||
|
||
import { useRouter } from "next/navigation";
|
||
import { LogOut } from "lucide-react";
|
||
import { authClient } from "@/lib/auth-client";
|
||
import { Button } from "@/components/ui/button";
|
||
|
||
export function SignOutButton() {
|
||
const router = useRouter();
|
||
return (
|
||
<Button
|
||
size="sm"
|
||
variant="ghost"
|
||
className="size-9 cursor-pointer rounded-full border border-slate-200 bg-white text-slate-600 transition-colors duration-200 hover:border-slate-300 hover:bg-slate-50 hover:text-slate-900 sm:size-12"
|
||
aria-label="Çıkış yap"
|
||
onClick={async () => {
|
||
await authClient.signOut();
|
||
router.refresh();
|
||
}}
|
||
>
|
||
<LogOut className="size-4 sm:size-5" aria-hidden />
|
||
</Button>
|
||
);
|
||
}
|