21 lines
552 B
TypeScript
21 lines
552 B
TypeScript
import { signOut } from "@/auth";
|
|
import { LogOut } from "lucide-react";
|
|
|
|
export default function SignOutButton() {
|
|
return (
|
|
<form
|
|
action={async () => {
|
|
"use server";
|
|
await signOut({ redirectTo: "/" });
|
|
}}
|
|
>
|
|
<button
|
|
type="submit"
|
|
className="flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-muted hover:text-foreground transition-colors w-full cursor-pointer"
|
|
>
|
|
<LogOut className="w-4 h-4" />
|
|
<span>Sign out</span>
|
|
</button>
|
|
</form>
|
|
);
|
|
}
|