"use client" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { User } from "@/lib/types" import { useClerk } from "@clerk/nextjs" import { LogOut, Sparkles } from "lucide-react" import { useRouter } from "next/navigation" import Avatar from "./avatar" export default function UserButton({ userData }: { userData: User }) { if (!userData) return null const { signOut } = useClerk() const router = useRouter() return (
{userData.name}
{userData.email}
AI Usage: {userData.generations}/1000
{/* Edit Profile */} signOut(() => router.push("/"))} className="!text-destructive cursor-pointer" > Log Out ) }