From b64356381d870fba01b104eb5cc927424d4a2318 Mon Sep 17 00:00:00 2001 From: Chneemann Date: Sat, 26 Sep 2026 20:03:05 +0200 Subject: [PATCH] refactor(settings): extract MEMBER_STATUS_OPTIONS into member constants --- components/settings/SettingsProfileCard.tsx | 10 ++-------- lib/constants/member.styles.ts | 22 +++++++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/components/settings/SettingsProfileCard.tsx b/components/settings/SettingsProfileCard.tsx index acc64fb..3918463 100644 --- a/components/settings/SettingsProfileCard.tsx +++ b/components/settings/SettingsProfileCard.tsx @@ -11,6 +11,7 @@ import { UserStatus } from "@/db/schema"; import { MEMBER_STATUS_COLOR_CLASSES, MEMBER_COLOR_OPTIONS, + MEMBER_STATUS_OPTIONS, } from "@/lib/constants/member.styles"; import { UserRound, Palette, ChevronDown } from "lucide-react"; import { useUser } from "@/lib/context/UserContext"; @@ -21,13 +22,6 @@ interface SettingsProfileCardProps { 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, @@ -72,7 +66,7 @@ export function SettingsProfileCard({ Online Status
- {STATUSES.map((status) => { + {MEMBER_STATUS_OPTIONS.map((status) => { const isSelected = currentUser.status === status.value; return (