karuracc_dev_test/components/SignOutButton.tsx
David Kiania fafef34304 Add Next.js app with Supabase auth, notes feature, and Docker setup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 15:43:09 +03:00

21 lines
503 B
TypeScript

"use client";
import { useRouter } from "next/navigation";
import { createClient } from "@/lib/supabase/client";
export function SignOutButton() {
const router = useRouter();
async function signOut() {
const supabase = createClient();
await supabase.auth.signOut();
router.push("/auth/login");
router.refresh();
}
return (
<button className="btn btn-ghost" style={{ padding: "0.35rem 0.8rem", fontSize: "0.72rem" }} onClick={signOut}>
Sign out
</button>
);
}