임동욱 임동욱 08-20
merge: 1:1문의 상태 배지
@7445c61ea8402a9930bc7eac72c1b2dd413c65d7
app/(protected)/(basic)/boards/_components/board-post-columns.tsx
--- app/(protected)/(basic)/boards/_components/board-post-columns.tsx
+++ app/(protected)/(basic)/boards/_components/board-post-columns.tsx
@@ -1,6 +1,6 @@
 'use client';
 
-import { FoxBadge } from '@fox/core/components/fox-badge';
+import { FoxBadge, type FoxBadgeColor } from '@fox/core/components/fox-badge';
 import { FoxIconButton } from '@fox/core/components/fox-icon-button';
 import { FoxStatusIndicator } from '@fox/core/components/fox-status-indicator';
 import type { FoxListColumn } from '@fox/core/components/fox-list-container';
@@ -8,6 +8,7 @@
 import { FoxPaperclipIcon } from '@fox/core/icons';
 import { formatPhoneNumber } from '@/lib/domain/phone-number';
 import {
+  EMPTY_FIELD_PLACEHOLDER,
   formatAnswerStatusLabel,
   formatBoardCategoryLabel,
   formatFaqTypeLabel,
@@ -138,6 +139,29 @@
   ];
 }
 
+// TODO: BBS_ANS_CD의 실제 코드값이 확인되면 코드값 기준 표로 바꾼다(관리자 권한 배지와 같은 방식).
+// 이슈: 코드값을 모르고 코드명도 코드관리 화면에서 바뀔 수 있어 코드명으로 색을 고른다.
+// 앞에서부터 먼저 걸리는 것을 쓴다 — 「미처리」가 「처리」보다 앞에 있어야 한다.
+const ANSWER_STATUS_BADGE_COLORS: readonly (readonly [string, FoxBadgeColor])[] = [
+  ['미답변', 'warning'],
+  ['미처리', 'warning'],
+  ['완료', 'success'],
+  ['반려', 'danger'],
+  ['보류', 'danger'],
+  ['취소', 'danger'],
+  ['처리', 'information'],
+  ['진행', 'information'],
+  ['접수', 'information'],
+  ['대기', 'warning'],
+];
+
+function answerStatusBadgeColor(label: string): FoxBadgeColor {
+  const matched = ANSWER_STATUS_BADGE_COLORS.find(([keyword]) =>
+    label.includes(keyword)
+  );
+  return matched?.[1] ?? 'neutral';
+}
+
 function inquiryColumns(
   page: number,
   pageSize: number,
@@ -179,12 +203,17 @@
       key: 'answerStatus',
       header: '상태',
       width: 120,
-      render: (row) => (
-        <FoxStatusIndicator
-          type={row.answeredAt ? 'success' : 'warning'}
-          label={formatAnswerStatusLabel(row.answerStatusCode, statusOptions)}
-        />
-      ),
+      render: (row) => {
+        if (!row.answerStatusCode) {
+          return EMPTY_FIELD_PLACEHOLDER;
+        }
+        const label = formatAnswerStatusLabel(row.answerStatusCode, statusOptions);
+        return (
+          <FoxBadge type="pastel" color={answerStatusBadgeColor(label)} size="md">
+            {label}
+          </FoxBadge>
+        );
+      },
     },
     {
       key: 'answeredAt',
Add a comment
List