Files
kolaytercih/src/components/sign-out-button.tsx

25 lines
745 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"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>
);
}