"use client"
import { createClient } from '@/lib/supabase/client'
import { Button } from './ui/button'
import { LogIn, LogOut, User } from 'lucide-react'
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
export function AuthButton({ user }: { user: any }) {
const supabase = createClient()
const handleSignIn = async () => {
await supabase.auth.signInWithOAuth({
provider: 'vatsim',
options: {
redirectTo: `${location.origin}/auth/callback`,
},
})
}
const handleSignOut = async () => {
await supabase.auth.signOut()
window.location.reload()
}
if (user) {
return (
Account
Sign Out
)
}
return (
)
}