import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { SidebarMenuButton } from "@/components/ui/sidebar" import { UserProfile } from "@/lib/auth" import { authClient } from "@/lib/auth-client" import { PLANS } from "@/lib/stripe" import { formatBytes } from "@/lib/utils" import { CreditCard, LogOut, MoreVertical, Settings, Sparkles, User } from "lucide-react" import Link from "next/link" import { redirect } from "next/navigation" export default function SidebarUser({ profile, isSelfHosted }: { profile: UserProfile; isSelfHosted: boolean }) { const signOut = async () => { await authClient.signOut({}) redirect("/") } return ( {profile.name || profile.email}
{profile.name || profile.email} {profile.email}
{PLANS[profile.membershipPlan as keyof typeof PLANS].name} {formatBytes(profile.storageUsed)} used Settings {!isSelfHosted && ( Billing )} {!isSelfHosted && ( <> Log out )}
) }