import { useMemo } from "react"
import {
ArrowLeft,
SlidersHorizontal,
UserRound,
type LucideIcon,
CreditCard,
Video,
} from "lucide-react"
type SettingsSection = "preferences" | "profile" | "streaming" | "billing"
interface UserProfile {
name?: string | null
email: string
image?: string | null
}
interface SettingsPanelProps {
activeSection: SettingsSection
onSelect: (section: SettingsSection) => void
profile?: UserProfile | null | undefined
}
type NavItem = {
id: SettingsSection
label: string
icon: LucideIcon
}
const navItems: NavItem[] = [
{ id: "preferences", label: "Preferences", icon: SlidersHorizontal },
{ id: "profile", label: "Profile", icon: UserRound },
{ id: "streaming", label: "Streaming", icon: Video },
{ id: "billing", label: "Manage Billing", icon: CreditCard },
]
function Avatar({ profile }: { profile?: UserProfile | null }) {
const initial = useMemo(() => {
if (!profile) return "G"
return (
profile.name?.slice(0, 1) ??
profile.email?.slice(0, 1)?.toUpperCase() ??
"G"
)
}, [profile])
if (profile?.image) {
return (
)
}
return (