"use client"; import { createClient } from "@/utils/supabase/client"; import Link from "next/link"; import crypto from 'crypto'; import { useRouter } from 'next/router'; export default async function AuthButton() { const supabase = createClient(); const { data: { user }, } = await supabase.auth.getUser(); const signOut = async () => { const supabase = createClient(); await supabase.auth.signOut(); window.location.href = "/gallery"; }; // ... const router = useRouter(); const currentPage = router.pathname; if(user){ let email = user.email; if(email != null){ const emailHash = crypto.createHash('md5').update(email.trim().toLowerCase()).digest('hex'); const gravatarUrl = `https://www.gravatar.com/avatar/${emailHash}`; return(