/** * @file components/settings/SettingsProfileCard.tsx * @description Collapsible card component managing user profile overview, status picker, and color selection. */ "use client"; import { useState } from "react"; import { UserAvatar } from "@/components/ui/UserAvatar"; import { UserStatus } from "@/db/schema"; import { MEMBER_STATUS_COLOR_CLASSES, MEMBER_COLOR_OPTIONS, } from "@/lib/constants/member.styles"; import { UserRound, Palette, ChevronDown } from "lucide-react"; import { useUser } from "@/lib/context/UserContext"; /** Props for the SettingsProfileCard component. */ interface SettingsProfileCardProps { onUpdate: (fields: Partial<{ status: UserStatus; color: string }>) => void; defaultOpen?: boolean; } const STATUSES: { label: string; value: UserStatus }[] = [ { label: "Online", value: "ONLINE" }, { label: "Offline", value: "OFFLINE" }, { label: "AFK", value: "AFK" }, { label: "DND", value: "DND" }, ]; /** Renders a collapsible card for managing user profile details, status, and theme color. */ export function SettingsProfileCard({ onUpdate, defaultOpen = true, }: SettingsProfileCardProps) { const [isOpen, setIsOpen] = useState(defaultOpen); const { currentUser } = useUser(); if (!currentUser) return null; return (