From e1d262cdf504002a96cd91e23e86965b87bb5598 Mon Sep 17 00:00:00 2001
From: Yared Yemane
Date: Sat, 1 Aug 2026 00:31:16 -0700
Subject: [PATCH] Render missing-value unassigned labels in italic.
Co-authored-by: Cursor
---
.../DynamicTableBuilder.tsx | 3 +-
.../NotificationDetailDialog.tsx | 5 +-
src/lib/displayValue.ts | 19 -------
src/lib/displayValue.tsx | 50 +++++++++++++++++++
src/pages/ProfilePage.tsx | 17 ++++---
.../content-management/AddNewLessonPage.tsx | 7 +--
.../content-management/CourseDetailPage.tsx | 3 +-
.../CourseManagementPage.tsx | 3 +-
.../CourseModuleDetailPage.tsx | 3 +-
src/pages/content-management/CoursesPage.tsx | 3 +-
.../HumanLanguageSubModulePage.tsx | 11 ++--
.../InitialAssessmentPage.tsx | 7 ++-
.../content-management/LearnEnglishPage.tsx | 3 +-
.../content-management/ModuleDetailPage.tsx | 5 +-
.../PracticeDetailsPage.tsx | 3 +-
.../PracticeQuestionsPage.tsx | 3 +-
.../content-management/ProgramCoursesPage.tsx | 3 +-
.../content-management/ProgramDetailPage.tsx | 7 +--
.../content-management/QuestionsPage.tsx | 11 ++--
src/pages/content-management/SpeakingPage.tsx | 35 ++++++-------
.../SubCourseContentPage.tsx | 3 +-
.../content-management/UnitManagementPage.tsx | 3 +-
.../components/QuestionTypeCard.tsx | 3 +-
.../QuestionTypeDefinitionPracticesDialog.tsx | 3 +-
.../PracticeSequentialReview.tsx | 7 +--
.../SelectPracticeToAttachStep.tsx | 7 ++-
.../QuestionTypeReviewPublishStep.tsx | 11 ++--
.../QuestionTypeValidatePreviewStep.tsx | 9 ++--
.../video-steps/ReviewPublishStep.tsx | 12 +++--
src/pages/faqs/FaqsPage.tsx | 3 +-
src/pages/faqs/components/FaqForm.tsx | 9 ++--
src/pages/issues/IssuesPage.tsx | 3 +-
.../notifications/AllNotificationsPage.tsx | 13 ++---
src/pages/notifications/NotificationsPage.tsx | 3 +-
.../ScheduledNotificationsPage.tsx | 3 +-
.../components/BulkSendSummaryPanel.tsx | 5 +-
src/pages/payments/PaymentsPage.tsx | 9 ++--
src/pages/team/TeamManagementPage.tsx | 7 +--
src/pages/team/TeamMemberDetailPage.tsx | 30 ++++++-----
.../components/ActivityLogListPanel.tsx | 11 ++--
.../user-management/DeletionRequestsPage.tsx | 13 ++---
src/pages/user-management/UserDetailPage.tsx | 30 ++++++-----
src/pages/user-management/UsersListPage.tsx | 7 +--
.../components/UserSubscriptionsSection.tsx | 4 +-
44 files changed, 250 insertions(+), 159 deletions(-)
delete mode 100644 src/lib/displayValue.ts
create mode 100644 src/lib/displayValue.tsx
diff --git a/src/components/content-management/DynamicTableBuilder.tsx b/src/components/content-management/DynamicTableBuilder.tsx
index 27fcbe2..d898dd1 100644
--- a/src/components/content-management/DynamicTableBuilder.tsx
+++ b/src/components/content-management/DynamicTableBuilder.tsx
@@ -3,6 +3,7 @@ import { Plus, Trash2 } from "lucide-react"
import { Button } from "../ui/button"
import { Input } from "../ui/input"
import { cn } from "../../lib/utils"
+import { UnassignedLabel } from "../../lib/displayValue"
import {
createEmptyTable,
parseTableSlotValue,
@@ -236,7 +237,7 @@ export function DynamicTableBuilder({
key={`preview-c-${ri}-${ci}`}
className="border border-grayScale-100 px-3 py-2 text-sm"
>
- {cell || unassigned}
+ {cell || }
))}
diff --git a/src/components/notifications/NotificationDetailDialog.tsx b/src/components/notifications/NotificationDetailDialog.tsx
index f9f573d..083b59c 100644
--- a/src/components/notifications/NotificationDetailDialog.tsx
+++ b/src/components/notifications/NotificationDetailDialog.tsx
@@ -18,6 +18,7 @@ import {
type Notification,
} from "../../types/notification.types";
import { cn } from "../../lib/utils";
+import { UnassignedLabel } from "../../lib/displayValue"
type NotificationDetailDialogProps = {
open: boolean;
@@ -187,9 +188,9 @@ function DetailsTab({
{[
{ k: "Type", v: formatNotificationTypeLabel(notification.type) },
- { k: "Channel", v: notification.delivery_channel || "unassigned" },
+ { k: "Channel", v: notification.delivery_channel || },
{ k: "Status", v: notification.is_read ? "Read" : "Unread" },
- { k: "Delivery", v: notification.delivery_status || "unassigned" },
+ { k: "Delivery", v: notification.delivery_status || },
...(notification.receiver_type
? [{ k: "Receiver", v: notification.receiver_type }]
: []),
diff --git a/src/lib/displayValue.ts b/src/lib/displayValue.ts
deleted file mode 100644
index 4a18d81..0000000
--- a/src/lib/displayValue.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-export const UNASSIGNED_LABEL = "unassigned"
-
-/** @deprecated Prefer UNASSIGNED_LABEL */
-export const NOT_ASSIGNED_LABEL = UNASSIGNED_LABEL
-
-const LEGACY_EMPTY_LABELS = new Set(["—", "-", "Not assigned", "not assigned"])
-
-export function displayValue(value: string | null | undefined): string {
- const trimmed = value?.trim()
- if (!trimmed || LEGACY_EMPTY_LABELS.has(trimmed) || trimmed === UNASSIGNED_LABEL) {
- return UNASSIGNED_LABEL
- }
- return trimmed
-}
-
-export function isUnassignedLabel(value: string | null | undefined): boolean {
- const trimmed = value?.trim()
- return !trimmed || trimmed === UNASSIGNED_LABEL || LEGACY_EMPTY_LABELS.has(trimmed)
-}
diff --git a/src/lib/displayValue.tsx b/src/lib/displayValue.tsx
new file mode 100644
index 0000000..2b4b959
--- /dev/null
+++ b/src/lib/displayValue.tsx
@@ -0,0 +1,50 @@
+import type { ReactNode } from "react"
+import { cn } from "./utils"
+
+export const UNASSIGNED_LABEL = "unassigned"
+
+/** @deprecated Prefer UNASSIGNED_LABEL */
+export const NOT_ASSIGNED_LABEL = UNASSIGNED_LABEL
+
+const LEGACY_EMPTY_LABELS = new Set(["—", "-", "Not assigned", "not assigned"])
+
+export function isUnassignedLabel(value: string | null | undefined): boolean {
+ const trimmed = value?.trim()
+ return !trimmed || trimmed === UNASSIGNED_LABEL || LEGACY_EMPTY_LABELS.has(trimmed)
+}
+
+export function displayValue(value: string | null | undefined): string {
+ const trimmed = value?.trim()
+ if (!trimmed || LEGACY_EMPTY_LABELS.has(trimmed) || trimmed === UNASSIGNED_LABEL) {
+ return UNASSIGNED_LABEL
+ }
+ return trimmed
+}
+
+export function UnassignedLabel({ className }: { className?: string }) {
+ return (
+ {UNASSIGNED_LABEL}
+ )
+}
+
+/** Renders a value, or an italic "unassigned" label when empty/missing. */
+export function DisplayValue({
+ value,
+ className,
+ unassignedClassName,
+}: {
+ value: string | number | null | undefined
+ className?: string
+ unassignedClassName?: string
+}): ReactNode {
+ if (typeof value === "number") {
+ if (!Number.isFinite(value)) {
+ return
+ }
+ return {value}
+ }
+ if (isUnassignedLabel(value)) {
+ return
+ }
+ return {value!.trim()}
+}
diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx
index dcdcbc5..03ebb7e 100644
--- a/src/pages/ProfilePage.tsx
+++ b/src/pages/ProfilePage.tsx
@@ -24,6 +24,7 @@ import { cn } from "../lib/utils";
import type { TeamMeProfile } from "../types/team.types";
import { ProfileAvatarUpload } from "../components/profile/ProfileAvatarUpload";
import { PersonaProfilePictureUploadField } from "./personas/components/PersonaProfilePictureUploadField";
+import { UnassignedLabel, isUnassignedLabel, DisplayValue } from "../lib/displayValue"
function formatDate(dateStr: string | null | undefined): string {
if (!dateStr) return "unassigned";
@@ -69,7 +70,7 @@ function FieldGroup({
mono,
}: {
label: string;
- value: string;
+ value: React.ReactNode;
mono?: boolean;
}) {
return (
@@ -81,7 +82,11 @@ function FieldGroup({
mono && "font-mono text-xs",
)}
>
- {value}
+ {typeof value === "string" && isUnassignedLabel(value) ? (
+
+ ) : (
+ value
+ )}
);
@@ -329,7 +334,7 @@ export function ProfilePage() {
-
+ } />
@@ -339,15 +344,15 @@ export function ProfilePage() {
}
/>
}
/>
}
/>
diff --git a/src/pages/content-management/AddNewLessonPage.tsx b/src/pages/content-management/AddNewLessonPage.tsx
index 9b09a21..7ea03a0 100644
--- a/src/pages/content-management/AddNewLessonPage.tsx
+++ b/src/pages/content-management/AddNewLessonPage.tsx
@@ -16,6 +16,7 @@ import { Card } from "../../components/ui/card"
import { Input } from "../../components/ui/input"
import { SpinnerIcon } from "../../components/ui/spinner-icon"
import type { QuestionOption } from "../../types/course.types"
+import { UnassignedLabel } from "../../lib/displayValue"
type Step = 1 | 2 | 3 | 4
type QuestionType = "MCQ" | "TRUE_FALSE" | "SHORT" | "AUDIO" | "DYNAMIC"
@@ -606,16 +607,16 @@ export function AddNewLessonPage() {
Description
- {lessonDescription || "unassigned"}
+ {lessonDescription || }
Intro video URL
- {introVideoUrl || "unassigned"}
+ {introVideoUrl || }
Sub-module
- {subModuleId ?? "unassigned"}
+ {subModuleId ?? }
diff --git a/src/pages/content-management/CourseDetailPage.tsx b/src/pages/content-management/CourseDetailPage.tsx
index 68c441a..a7d62de 100644
--- a/src/pages/content-management/CourseDetailPage.tsx
+++ b/src/pages/content-management/CourseDetailPage.tsx
@@ -58,6 +58,7 @@ import { AddModuleModal } from "./components/AddModuleModal";
import { ModuleIconUploadField } from "./components/ModuleIconUploadField";
import { ModulePracticeCard } from "./components/ModulePracticeCard";
import { PublishPracticeButton } from "./components/PublishPracticeButton";
+import { UnassignedLabel } from "../../lib/displayValue"
const MODULE_CARD_GRADIENT = "from-[#8E44AD] to-[#C39BD3]" as const;
@@ -787,7 +788,7 @@ export function CourseDetailPage() {
{module.description?.trim()
? module.description
- : "unassigned"}
+ : }
diff --git a/src/pages/content-management/CourseManagementPage.tsx b/src/pages/content-management/CourseManagementPage.tsx
index 6968b98..0521bce 100644
--- a/src/pages/content-management/CourseManagementPage.tsx
+++ b/src/pages/content-management/CourseManagementPage.tsx
@@ -47,6 +47,7 @@ import { ContentAccessTierChip } from "./components/ContentAccessTierChip";
import { ContentListSearchFilterBar } from "./components/ContentListSearchFilterBar";
import { ContentPageDescription } from "./components/ContentPageDescription";
import type { ContentAccessTier, PracticePublishStatus } from "../../types/course.types";
+import { UnassignedLabel } from "../../lib/displayValue"
import {
filterBySearchAndPublishStatus,
type PublishStatusFilter,
@@ -166,7 +167,7 @@ export function CourseManagementPage() {
list.map((row, index) => ({
id: Number(row.id),
name: row.name?.trim() || `Unit ${row.id}`,
- description: row.description?.trim() || "unassigned",
+ description: row.description?.trim() || ,
thumbnail: row.thumbnail?.trim() || "",
sortOrder: Number(row.sort_order ?? 0),
publishStatus: row.publish_status ?? null,
diff --git a/src/pages/content-management/CourseModuleDetailPage.tsx b/src/pages/content-management/CourseModuleDetailPage.tsx
index 3c26914..3cd66b0 100644
--- a/src/pages/content-management/CourseModuleDetailPage.tsx
+++ b/src/pages/content-management/CourseModuleDetailPage.tsx
@@ -46,6 +46,7 @@ import type {
import { ContentListSearchFilterBar } from "./components/ContentListSearchFilterBar";
import { ContentPageDescription } from "./components/ContentPageDescription";
import { ContentPublishStatusChip } from "./components/ContentPublishStatusChip";
+import { UnassignedLabel } from "../../lib/displayValue"
import {
filterBySearchAndPublishStatus,
type PublishStatusFilter,
@@ -173,7 +174,7 @@ export function CourseModuleDetailPage() {
const row = list.find((m) => Number(m.id) === parsedModuleId);
if (row) {
setModuleTitle(row.name?.trim() || `Module ${parsedModuleId}`);
- setModuleDescription(row.description?.trim() || "unassigned");
+ setModuleDescription(row.description?.trim() || );
setModulePublishStatus(row.publish_status ?? null);
} else {
setModuleTitle(`Module ${parsedModuleId}`);
diff --git a/src/pages/content-management/CoursesPage.tsx b/src/pages/content-management/CoursesPage.tsx
index 5c67fa0..b4e54b0 100644
--- a/src/pages/content-management/CoursesPage.tsx
+++ b/src/pages/content-management/CoursesPage.tsx
@@ -41,6 +41,7 @@ import {
import type { CategorySubCategoryListItem, CourseCategory } from "../../types/course.types"
import { cn } from "../../lib/utils"
import { TABLE_PAGE_SIZE_OPTIONS } from "../../lib/tablePagination"
+import { UnassignedLabel } from "../../lib/displayValue"
export function CoursesPage() {
const { categoryId } = useParams<{ categoryId: string }>()
@@ -415,7 +416,7 @@ export function CoursesPage() {
- {sub.description?.trim() ? sub.description : "unassigned"}
+ {sub.description?.trim() ? sub.description : }
diff --git a/src/pages/content-management/HumanLanguageSubModulePage.tsx b/src/pages/content-management/HumanLanguageSubModulePage.tsx
index c962073..32624e1 100644
--- a/src/pages/content-management/HumanLanguageSubModulePage.tsx
+++ b/src/pages/content-management/HumanLanguageSubModulePage.tsx
@@ -24,6 +24,7 @@ import {
softDeleteSubModuleLesson,
updateSubModuleLesson,
} from "../../api/courses.api"
+import { UnassignedLabel } from "../../lib/displayValue"
import type {
QuestionSet,
QuestionSetStatus,
@@ -526,12 +527,12 @@ export function HumanLanguageSubModulePage() {
{questionSetStatusBadge(item.status)}
- {item.description?.trim() ? item.description : "unassigned"}
+ {item.description?.trim() ? item.description : }
- {item.persona?.trim() ? item.persona : "unassigned"}
+ {item.persona?.trim() ? item.persona : }
@@ -673,7 +674,7 @@ export function HumanLanguageSubModulePage() {
{lessonStatusBadge(lesson.is_active)}
- {lesson.description?.trim() ? lesson.description : "unassigned"}
+ {lesson.description?.trim() ? lesson.description : }
@@ -985,7 +986,7 @@ export function HumanLanguageSubModulePage() {
- {v.description?.trim() ? v.description : "unassigned"}
+ {v.description?.trim() ? v.description : }
@@ -1031,7 +1032,7 @@ export function HumanLanguageSubModulePage() {
) : (
- unassigned
+
)}
diff --git a/src/pages/content-management/InitialAssessmentPage.tsx b/src/pages/content-management/InitialAssessmentPage.tsx
index eb2e5c0..8052652 100644
--- a/src/pages/content-management/InitialAssessmentPage.tsx
+++ b/src/pages/content-management/InitialAssessmentPage.tsx
@@ -46,6 +46,7 @@ import { Textarea } from "../../components/ui/textarea"
import { ToggleSwitch } from "../../components/ui/toggle-switch"
import { cn } from "../../lib/utils"
import type { QuestionSetDetail } from "../../types/course.types"
+import { UnassignedLabel } from "../../lib/displayValue"
type TabId = "set" | "questions" | "thresholds"
type DraftQuestionType = "MCQ" | "TRUE_FALSE"
@@ -817,13 +818,15 @@ export function InitialAssessmentPage() {
>
{(() => {
const value = String(q.difficultyLevel ?? "").trim()
- if (!value || value === "unassigned" || value === "-") return "unassigned"
+ if (!value || value === "unassigned" || value === "-") {
+ return
+ }
return value.toLowerCase()
})()}
- {Number.isFinite(q.points) ? q.points : "unassigned"}
+ {Number.isFinite(q.points) ? q.points : }
e.stopPropagation()}>
diff --git a/src/pages/content-management/LearnEnglishPage.tsx b/src/pages/content-management/LearnEnglishPage.tsx
index bfd333e..a71cc0f 100644
--- a/src/pages/content-management/LearnEnglishPage.tsx
+++ b/src/pages/content-management/LearnEnglishPage.tsx
@@ -42,6 +42,7 @@ import {
} from "../../lib/contentListFilters";
import { refreshFileUrl, uploadImageFile } from "../../api/files.api";
import type { LearningProgramListItem } from "../../types/course.types";
+import { UnassignedLabel } from "../../lib/displayValue"
/** Presigned MinIO/S3 URLs and our storage hosts — safe to send to POST /files/refresh-url. */
function looksLikeRefreshableFileUrl(url: string): boolean {
@@ -732,7 +733,7 @@ export function LearnEnglishPage() {
{program.description?.trim()
? program.description
- : "unassigned"}
+ : }
{
if (hasNavName) {
- return navState?.moduleDescription?.trim() || "unassigned";
+ return navState?.moduleDescription?.trim() || ;
}
if (!moduleListResolved) {
return "Loading…";
}
if (loadedModuleDescription !== null) {
- return loadedModuleDescription.trim() || "unassigned";
+ return loadedModuleDescription.trim() || ;
}
return "unassigned";
})();
diff --git a/src/pages/content-management/PracticeDetailsPage.tsx b/src/pages/content-management/PracticeDetailsPage.tsx
index dd47499..28857d1 100644
--- a/src/pages/content-management/PracticeDetailsPage.tsx
+++ b/src/pages/content-management/PracticeDetailsPage.tsx
@@ -41,6 +41,7 @@ import { CreatePracticeWizard } from "./components/CreatePracticeWizard"
import type { PracticeParentKind } from "../../types/course.types"
import { cn } from "../../lib/utils"
import { PageBackLink } from "../../components/navigation/PageBackLink"
+import { UnassignedLabel } from "../../lib/displayValue"
type ParentTab = "course" | "module" | "lesson"
@@ -994,7 +995,7 @@ export function PracticeDetailsPage() {
Story
- {practice.story_description?.trim() || "unassigned"}
+ {practice.story_description?.trim() || }
{quickTipParts.length > 0 && (
diff --git a/src/pages/content-management/PracticeQuestionsPage.tsx b/src/pages/content-management/PracticeQuestionsPage.tsx
index d641716..0551ff6 100644
--- a/src/pages/content-management/PracticeQuestionsPage.tsx
+++ b/src/pages/content-management/PracticeQuestionsPage.tsx
@@ -21,6 +21,7 @@ import { Select } from "../../components/ui/select"
import { Textarea } from "../../components/ui/textarea"
import type { PracticeQuestion, QuestionSetQuestion, QuestionDetail } from "../../types/course.types"
import { DEFAULT_TABLE_PAGE_SIZE, TABLE_PAGE_SIZE_OPTIONS } from "../../lib/tablePagination"
+import { UnassignedLabel } from "../../lib/displayValue"
type QuestionType = "MCQ" | "TRUE_FALSE" | "SHORT" | "AUDIO"
type DifficultyLevel = "EASY" | "MEDIUM" | "HARD"
@@ -647,7 +648,7 @@ export function PracticeQuestionsPage() {
Points: {question.points ?? 0}
- Difficulty: {question.difficulty_level || "unassigned"}
+ Difficulty: {question.difficulty_level || }
diff --git a/src/pages/content-management/ProgramCoursesPage.tsx b/src/pages/content-management/ProgramCoursesPage.tsx
index 2fd9237..12e2f36 100644
--- a/src/pages/content-management/ProgramCoursesPage.tsx
+++ b/src/pages/content-management/ProgramCoursesPage.tsx
@@ -46,6 +46,7 @@ import type {
ProgramCourseListItem,
} from "../../types/course.types";
import { PublishPracticeButton } from "./components/PublishPracticeButton";
+import { UnassignedLabel } from "../../lib/displayValue"
export function ProgramCoursesPage() {
const navigate = useNavigate();
@@ -759,7 +760,7 @@ export function ProgramCoursesPage() {
{course.name}
- {course.description?.trim() ? course.description : "unassigned"}
+ {course.description?.trim() ? course.description : }
diff --git a/src/pages/content-management/ProgramDetailPage.tsx b/src/pages/content-management/ProgramDetailPage.tsx
index b76c42c..1d1cd03 100644
--- a/src/pages/content-management/ProgramDetailPage.tsx
+++ b/src/pages/content-management/ProgramDetailPage.tsx
@@ -44,6 +44,7 @@ import {
} from "../../lib/contentListFilters";
import { uploadImageFile } from "../../api/files.api";
import uploadIcon from "../../assets/icons/upload.png";
+import { UnassignedLabel } from "../../lib/displayValue"
export function ProgramDetailPage() {
const navigate = useNavigate();
@@ -116,7 +117,7 @@ export function ProgramDetailPage() {
list.map((row) => ({
id: Number(row.id),
name: row.name?.trim() || `Course ${row.id}`,
- description: row.description?.trim() || "unassigned",
+ description: row.description?.trim() ||
,
thumbnail: row.thumbnail?.trim() || null,
sortOrder: Number(row.sort_order ?? 0),
publishStatus: row.publish_status ?? null,
@@ -310,7 +311,7 @@ export function ProgramDetailPage() {
{
id: row.id,
name: row.name ?? name,
- description: row.description?.trim() || "unassigned",
+ description: row.description?.trim() ||
,
thumbnail: row.thumbnail?.trim() || null,
sortOrder: Number(row.sort_order ?? 0),
unitsCount: Number(row.units_count ?? 0),
@@ -409,7 +410,7 @@ export function ProgramDetailPage() {
? {
...course,
name: row?.name ?? name,
- description: row?.description?.trim() || preservedDescription || "unassigned",
+ description: row?.description?.trim() || preservedDescription ||
,
thumbnail: row?.thumbnail?.trim() || null,
sortOrder: Number(row?.sort_order ?? sortOrderNum),
unitsCount: Number(row?.units_count ?? course.unitsCount ?? 0),
diff --git a/src/pages/content-management/QuestionsPage.tsx b/src/pages/content-management/QuestionsPage.tsx
index 8ac50f6..849c67d 100644
--- a/src/pages/content-management/QuestionsPage.tsx
+++ b/src/pages/content-management/QuestionsPage.tsx
@@ -23,6 +23,7 @@ import type { QuestionDetail } from "../../types/course.types"
import { cn } from "../../lib/utils"
import { PageBackLink } from "../../components/navigation/PageBackLink"
import { TABLE_PAGE_SIZE_OPTIONS } from "../../lib/tablePagination"
+import { UnassignedLabel } from "../../lib/displayValue"
type QuestionTypeFilter = "all" | "MCQ" | "TRUE_FALSE" | "SHORT_ANSWER" | "AUDIO"
type DifficultyFilter = "all" | "EASY" | "MEDIUM" | "HARD"
@@ -523,7 +524,7 @@ export function QuestionsPage() {
)}
- {question.status || "unassigned"}
+ {question.status || }
{question.points ?? 0}
@@ -696,10 +697,10 @@ export function QuestionsPage() {
ID: {detailData.id}
Type: {typeLabels[detailData.question_type] || detailData.question_type}
-
Difficulty: {detailData.difficulty_level || "unassigned"}
+
Difficulty: {detailData.difficulty_level || }
Points: {detailData.points ?? 0}
-
Status: {detailData.status || "unassigned"}
-
Created: {detailData.created_at || "unassigned"}
+
Status: {detailData.status || }
+
Created: {detailData.created_at || }
{detailData.explanation ? (
@@ -755,7 +756,7 @@ export function QuestionsPage() {
: (answer as { acceptable_answer?: string }).acceptable_answer || ""
return (
- {value || "unassigned"}
+ {value || }
)
})}
diff --git a/src/pages/content-management/SpeakingPage.tsx b/src/pages/content-management/SpeakingPage.tsx
index 6fd3489..a948449 100644
--- a/src/pages/content-management/SpeakingPage.tsx
+++ b/src/pages/content-management/SpeakingPage.tsx
@@ -38,6 +38,7 @@ import { toast } from "sonner"
import { countActiveFilters } from "../../lib/adminFilterUtils"
import { fetchAllOffsetPages } from "../../lib/fetchAllOffsetPages"
import { DEFAULT_TABLE_PAGE_SIZE, TABLE_PAGE_SIZE_OPTIONS } from "../../lib/tablePagination"
+import { UnassignedLabel } from "../../lib/displayValue"
const MAX_AUDIO_SIZE_BYTES = 50 * 1024 * 1024
const ALLOWED_AUDIO_EXTENSIONS = new Set(["mp3", "wav", "ogg", "m4a", "aac", "webm", "flac"])
@@ -1275,7 +1276,7 @@ export function SpeakingPage() {
const groupedAudioQuestions = useMemo(() => {
const groups = new Map
()
for (const q of audioQuestions) {
- const key = q.practice_id ? String(q.practice_id) : "unassigned"
+ const key = q.practice_id ? String(q.practice_id) :
const title = q.practice_title || "Unknown practice"
if (!groups.has(key)) {
groups.set(key, { practiceId: q.practice_id, practiceTitle: title, questions: [] })
@@ -1498,13 +1499,13 @@ export function SpeakingPage() {
AUDIO
- Difficulty: {question.difficulty_level || "unassigned"}
+ Difficulty: {question.difficulty_level || }
Points: {question.points ?? 0}
- Status: {question.status || "unassigned"}
+ Status: {question.status || }
{question.image_url && imagePreviewByQuestionId[question.id] ? (
@@ -1788,19 +1789,19 @@ export function SpeakingPage() {
Status
-
{selectedQuestionDetail.status || "unassigned"}
+
{selectedQuestionDetail.status || }
Points
-
{selectedQuestionDetail.points ?? "unassigned"}
+
{selectedQuestionDetail.points ?? }
Difficulty
-
{selectedQuestionDetail.difficulty_level || "unassigned"}
+
{selectedQuestionDetail.difficulty_level || }
Type
-
{selectedQuestionDetail.question_type || "unassigned"}
+
{selectedQuestionDetail.question_type || }
{selectedQuestionDetail.audio_correct_answer_text ? (
@@ -2440,11 +2441,11 @@ export function SpeakingPage() {
Practice
-
Title: {setTitle || "unassigned"}
-
Course ID: {subCourseId || "unassigned"}
-
Description: {setDescription || "unassigned"}
+
Title: {setTitle || }
+
Course ID: {subCourseId || }
+
Description: {setDescription || }
- Intro video URL: {introVideoUrl.trim() || "unassigned"}
+ Intro video URL: {introVideoUrl.trim() || }
Status: {setStatus}
@@ -2467,27 +2468,27 @@ export function SpeakingPage() {
Status: {setStatus}
Voice Prompt:{" "}
- {draft.voicePrompt.trim() || "unassigned"}
+ {draft.voicePrompt.trim() || }
Sample Answer Voice Prompt:{" "}
- {draft.sampleAnswerVoicePrompt.trim() || "unassigned"}
+ {draft.sampleAnswerVoicePrompt.trim() || }
Image URL:{" "}
- {draft.imageUrl.trim() || "unassigned"}
+ {draft.imageUrl.trim() || }
Audio Correct Answer Text:{" "}
- {draft.audioCorrectAnswerText.trim() || "unassigned"}
+ {draft.audioCorrectAnswerText.trim() || }
Tips:{" "}
- {draft.tips.trim() || "unassigned"}
+ {draft.tips.trim() || }
Explanation:{" "}
- {draft.explanation.trim() || "unassigned"}
+ {draft.explanation.trim() || }
diff --git a/src/pages/content-management/SubCourseContentPage.tsx b/src/pages/content-management/SubCourseContentPage.tsx
index 82b44c4..f7a3059 100644
--- a/src/pages/content-management/SubCourseContentPage.tsx
+++ b/src/pages/content-management/SubCourseContentPage.tsx
@@ -32,6 +32,7 @@ import type {
} from "../../types/course.types"
import type { Rating } from "../../types/ratings.types"
import { SpinnerIcon } from "../../components/ui/spinner-icon"
+import { UnassignedLabel } from "../../lib/displayValue"
type TabType = "video" | "practice" | "ratings"
type StatusFilter = "all" | "published" | "draft" | "archived"
@@ -625,7 +626,7 @@ export function SubModuleContentPage() {
day: "numeric",
year: "numeric",
})
- : "unassigned"}
+ :
}
e.stopPropagation()}>
@@ -303,7 +304,7 @@ export function PracticeSequentialReview({
Text prompt
- {question.questionText.trim() || "unassigned"}
+ {question.questionText.trim() || }
{question.voicePrompt.trim() ? (
@@ -358,7 +359,7 @@ export function PracticeSequentialReview({
/>
) : (
- unassigned
+
)}
))}
diff --git a/src/pages/content-management/components/practice-steps/SelectPracticeToAttachStep.tsx b/src/pages/content-management/components/practice-steps/SelectPracticeToAttachStep.tsx
index 369bfe3..f27ba1b 100644
--- a/src/pages/content-management/components/practice-steps/SelectPracticeToAttachStep.tsx
+++ b/src/pages/content-management/components/practice-steps/SelectPracticeToAttachStep.tsx
@@ -13,6 +13,7 @@ import { DEFAULT_TABLE_PAGE_SIZE, TABLE_PAGE_SIZE_OPTIONS } from "../../../../li
import type { ParentContextPractice, PracticeParent } from "../../../../types/course.types"
import { cn } from "../../../../lib/utils"
import { SearchHighlight, getSearchTokens } from "../../../../components/SearchHighlight"
+import { UnassignedLabel } from "../../../../lib/displayValue"
interface SelectPracticeToAttachStepProps {
targetParent: PracticeParent
@@ -254,7 +255,11 @@ export function SelectPracticeToAttachStep({
publishStatusClass(practice.publish_status),
)}
>
- {(practice.publish_status || "unassigned").toString()}
+ {practice.publish_status?.trim() ? (
+ practice.publish_status
+ ) : (
+
+ )}
{alreadyLinked ? (
diff --git a/src/pages/content-management/components/question-type-steps/QuestionTypeReviewPublishStep.tsx b/src/pages/content-management/components/question-type-steps/QuestionTypeReviewPublishStep.tsx
index 595bbda..41586ae 100644
--- a/src/pages/content-management/components/question-type-steps/QuestionTypeReviewPublishStep.tsx
+++ b/src/pages/content-management/components/question-type-steps/QuestionTypeReviewPublishStep.tsx
@@ -20,6 +20,7 @@ import {
} from "../../lib/questionTypeDefinitionValidation"
import { slotLabel } from "./componentKindUi"
import { questionTypeGroupLabels } from "../../../../lib/questionTypeGroupIds"
+import { UnassignedLabel } from "../../../../lib/displayValue"
interface QuestionTypeReviewPublishStepProps {
draft: QuestionTypeDefinitionCreatePayload
@@ -131,11 +132,11 @@ export function QuestionTypeReviewPublishStep({
Description
- {payload.description || "unassigned"}
+ {payload.description || }
Groups
- {groupName || "unassigned"}
+ {groupName || }
Status
@@ -143,15 +144,15 @@ export function QuestionTypeReviewPublishStep({
Runtime type
- {runtime ?? "unassigned"}
+ {runtime ?? }
Stimulus kinds
- {payload.stimulus_component_kinds.join(", ") || "unassigned"}
+ {payload.stimulus_component_kinds.join(", ") || }
Response kinds
- {payload.response_component_kinds.join(", ") || "unassigned"}
+ {payload.response_component_kinds.join(", ") || }
diff --git a/src/pages/content-management/components/question-type-steps/QuestionTypeValidatePreviewStep.tsx b/src/pages/content-management/components/question-type-steps/QuestionTypeValidatePreviewStep.tsx
index 8283d77..b3f0fa2 100644
--- a/src/pages/content-management/components/question-type-steps/QuestionTypeValidatePreviewStep.tsx
+++ b/src/pages/content-management/components/question-type-steps/QuestionTypeValidatePreviewStep.tsx
@@ -11,6 +11,7 @@ import {
} from "../../lib/questionTypeDefinitionValidation"
import { DefinitionRuntimeHint } from "./DefinitionRuntimeHint"
import { QuestionTypeStepFooter } from "./QuestionTypeStepFooter"
+import { UnassignedLabel } from "../../../../lib/displayValue"
interface QuestionTypeValidatePreviewStepProps {
draft: QuestionTypeDefinitionCreatePayload
@@ -118,13 +119,13 @@ export function QuestionTypeValidatePreviewStep({
Stimulus kinds
- {payload.stimulus_component_kinds.join(", ") || "unassigned"}
+ {payload.stimulus_component_kinds.join(", ") || }
Response kinds
- {payload.response_component_kinds.join(", ") || "unassigned"}
+ {payload.response_component_kinds.join(", ") || }
@@ -132,7 +133,7 @@ export function QuestionTypeValidatePreviewStep({
{payload.stimulus_schema.length
? payload.stimulus_schema.map((r) => r.label).join(" · ")
- : "unassigned"}
+ : }
@@ -140,7 +141,7 @@ export function QuestionTypeValidatePreviewStep({
{payload.response_schema.length
? payload.response_schema.map((r) => r.label).join(" · ")
- : "unassigned"}
+ : }
diff --git a/src/pages/content-management/components/video-steps/ReviewPublishStep.tsx b/src/pages/content-management/components/video-steps/ReviewPublishStep.tsx
index a0b1da0..5c32815 100644
--- a/src/pages/content-management/components/video-steps/ReviewPublishStep.tsx
+++ b/src/pages/content-management/components/video-steps/ReviewPublishStep.tsx
@@ -11,6 +11,7 @@ import {
resolveThumbnailForPreview,
} from "../../../../lib/videoPreview";
import { PreviewLimitedFileVideo } from "../PreviewLimitedFileVideo";
+import { UnassignedLabel } from "../../../../lib/displayValue"
interface ReviewPublishStepProps {
formData: AddLessonFormData;
@@ -115,7 +116,7 @@ export function ReviewPublishStep({
) : (
- unassigned
+
)}
@@ -148,7 +149,7 @@ export function ReviewPublishStep({
) : (
- unassigned
+
)}
@@ -176,7 +177,7 @@ export function ReviewPublishStep({
Title
- {formData.title || "unassigned"}
+ {formData.title || }
@@ -187,7 +188,7 @@ export function ReviewPublishStep({
{formData.sortOrder.trim() !== ""
? formData.sortOrder.trim()
- : "unassigned"}
+ : }
@@ -199,7 +200,8 @@ export function ReviewPublishStep({
className="text-[14px] text-grayScale-600 leading-relaxed max-w-4xl"
dangerouslySetInnerHTML={{
__html:
- formData.description || "unassigned
",
+ formData.description ||
+ "unassigned
",
}}
/>
diff --git a/src/pages/faqs/FaqsPage.tsx b/src/pages/faqs/FaqsPage.tsx
index 26fcbb5..72b6c35 100644
--- a/src/pages/faqs/FaqsPage.tsx
+++ b/src/pages/faqs/FaqsPage.tsx
@@ -48,6 +48,7 @@ import { CreateFaqDialog } from "./components/CreateFaqDialog"
import { FaqDeleteDialog } from "./components/FaqDeleteDialog"
import { FaqAccessDenied } from "./components/FaqAccessDenied"
import { FaqPublicPreviewDialog } from "./components/FaqPublicPreviewDialog"
+import { UnassignedLabel } from "../../lib/displayValue"
type StatusFilter = "all" | FAQStatus
@@ -339,7 +340,7 @@ export function FaqsPage() {
{faq.category ? (
{faq.category}
) : (
- unassigned
+
)}
diff --git a/src/pages/faqs/components/FaqForm.tsx b/src/pages/faqs/components/FaqForm.tsx
index 22006de..fe3379b 100644
--- a/src/pages/faqs/components/FaqForm.tsx
+++ b/src/pages/faqs/components/FaqForm.tsx
@@ -2,6 +2,7 @@ import { Button } from "../../../components/ui/button"
import { Input } from "../../../components/ui/input"
import { Textarea } from "../../../components/ui/textarea"
import type { FAQStatus } from "../../../types/faq.types"
+import { UnassignedLabel } from "../../../lib/displayValue"
export type FaqFormDraft = {
question: string
@@ -127,10 +128,10 @@ export function FaqForm({
Preview
- {draft.question || "unassigned"}
+ {draft.question || }
- {draft.answer || "unassigned"}
+ {draft.answer || }
{(draft.category || draft.display_order) && (
@@ -149,10 +150,10 @@ export function FaqForm({
Preview
- {draft.question || "unassigned"}
+ {draft.question || }
- {draft.answer || "unassigned"}
+ {draft.answer || }
{(draft.category || draft.display_order) && (
diff --git a/src/pages/issues/IssuesPage.tsx b/src/pages/issues/IssuesPage.tsx
index 0ee50c6..4636c50 100644
--- a/src/pages/issues/IssuesPage.tsx
+++ b/src/pages/issues/IssuesPage.tsx
@@ -51,6 +51,7 @@ import {
createIssue,
} from "../../api/issues.api";
import type { Issue } from "../../types/issue.types";
+import { UnassignedLabel } from "../../lib/displayValue"
// ── Status configuration ───────────────────────────────────────────
const STATUSES = ["pending", "in_progress", "resolved", "rejected"] as const;
@@ -532,7 +533,7 @@ export function IssuesPage() {
- {issue.subject?.trim() ? issue.subject : "unassigned"}
+ {issue.subject?.trim() ? issue.subject : }
{issue.description?.trim() ? issue.description : "No description"}
diff --git a/src/pages/notifications/AllNotificationsPage.tsx b/src/pages/notifications/AllNotificationsPage.tsx
index e107487..aa75b2e 100644
--- a/src/pages/notifications/AllNotificationsPage.tsx
+++ b/src/pages/notifications/AllNotificationsPage.tsx
@@ -32,6 +32,7 @@ import { cn } from "../../lib/utils"
import {
DEFAULT_TABLE_PAGE_SIZE,
} from "../../lib/tablePagination"
+import { UnassignedLabel } from "../../lib/displayValue"
import {
getNotificationMessage,
getNotificationTitle,
@@ -72,7 +73,7 @@ function recipientLabel(notification: Notification): string {
if (notification.reciever) {
parts.push(notification.reciever)
}
- return parts.length > 0 ? parts.join(" · ") : "unassigned"
+ return parts.length > 0 ? parts.join(" · ") :
}
export function AllNotificationsPage() {
@@ -355,14 +356,14 @@ export function AllNotificationsPage() {
- {getNotificationTitle(notification) || "unassigned"}
+ {getNotificationTitle(notification) || }
- {getNotificationMessage(notification) || "unassigned"}
+ {getNotificationMessage(notification) || }
- {channelLabel(notification.delivery_channel) || "unassigned"}
+ {channelLabel(notification.delivery_channel) || }
{formatNotificationTypeLabel(notification.type)}
@@ -372,7 +373,7 @@ export function AllNotificationsPage() {
variant={getNotificationLevelBadge(notification.level)}
className="text-[10px]"
>
- {notification.level || "unassigned"}
+ {notification.level || }
@@ -381,7 +382,7 @@ export function AllNotificationsPage() {
- {notification.delivery_status || "unassigned"}
+ {notification.delivery_status || }
{formatNotificationTimestamp(notification.timestamp)}
diff --git a/src/pages/notifications/NotificationsPage.tsx b/src/pages/notifications/NotificationsPage.tsx
index 4bd68ff..6b6213c 100644
--- a/src/pages/notifications/NotificationsPage.tsx
+++ b/src/pages/notifications/NotificationsPage.tsx
@@ -53,6 +53,7 @@ import { NOTIFICATION_REALTIME_EVENT } from "../../lib/notificationsWebSocket"
import { toast } from "sonner"
import { TablePagination } from "../../components/admin/TablePagination"
import { DEFAULT_TABLE_PAGE_SIZE } from "../../lib/tablePagination"
+import { UnassignedLabel } from "../../lib/displayValue"
function NotificationItem({
notification,
@@ -520,7 +521,7 @@ export function NotificationsPage() {
Channels used
- {Array.from(new Set(notifications.map((n) => n.delivery_channel))).length || "unassigned"}
+ {Array.from(new Set(notifications.map((n) => n.delivery_channel))).length || }
diff --git a/src/pages/notifications/ScheduledNotificationsPage.tsx b/src/pages/notifications/ScheduledNotificationsPage.tsx
index 4b2ba0c..4344f85 100644
--- a/src/pages/notifications/ScheduledNotificationsPage.tsx
+++ b/src/pages/notifications/ScheduledNotificationsPage.tsx
@@ -37,6 +37,7 @@ import {
import { countActiveFilters } from "../../lib/adminFilterUtils"
import { cn } from "../../lib/utils"
import { DEFAULT_TABLE_PAGE_SIZE } from "../../lib/tablePagination"
+import { UnassignedLabel } from "../../lib/displayValue"
import type {
NotificationChannel,
ScheduledNotification,
@@ -261,7 +262,7 @@ export function ScheduledNotificationsPage() {
{channelLabel(job.channel)}
- {job.title || "unassigned"}
+ {job.title || }
{job.message}
{job.channel === "email" && job.email_template_slug ? (
diff --git a/src/pages/notifications/components/BulkSendSummaryPanel.tsx b/src/pages/notifications/components/BulkSendSummaryPanel.tsx
index 9f5f1a1..7b6a4f9 100644
--- a/src/pages/notifications/components/BulkSendSummaryPanel.tsx
+++ b/src/pages/notifications/components/BulkSendSummaryPanel.tsx
@@ -15,6 +15,7 @@ import { Card, CardContent } from "../../../components/ui/card"
import { channelLabel, formatScheduledAtLabel } from "../../../lib/notificationBulk"
import { cn } from "../../../lib/utils"
import type { NotificationChannel } from "../../../types/notification.types"
+import { UnassignedLabel } from "../../../lib/displayValue"
export type BulkSendSummary =
| {
@@ -177,9 +178,9 @@ export function BulkSendSummaryPanel({ summary, onDismiss }: BulkSendSummaryPane
Content
- {summary.titlePreview || "unassigned"}
+ {summary.titlePreview || }
- {summary.messagePreview || "unassigned"}
+ {summary.messagePreview || }
{!isImmediate && summary.emailTemplateSlug ? (
Template: {summary.emailTemplateSlug}
diff --git a/src/pages/payments/PaymentsPage.tsx b/src/pages/payments/PaymentsPage.tsx
index dfc0cb2..a815e1f 100644
--- a/src/pages/payments/PaymentsPage.tsx
+++ b/src/pages/payments/PaymentsPage.tsx
@@ -61,6 +61,7 @@ import type {
} from "../../types/payment.types"
import { DEFAULT_TABLE_PAGE_SIZE, TABLE_PAGE_SIZE_OPTIONS } from "../../lib/tablePagination"
+import { UnassignedLabel } from "../../lib/displayValue"
const STATUS_FILTERS: { value: PaymentStatus; label: string }[] = [
{ value: "PENDING", label: "Pending" },
@@ -518,7 +519,7 @@ export function PaymentsPage() {
#{payment.id}
- {payment.transaction_id || payment.session_id || "unassigned"}
+ {payment.transaction_id || payment.session_id || }
|
@@ -716,11 +717,11 @@ export function PaymentsPage() {
{[
{ k: "Customer", v: paymentCustomerName(selected) },
- { k: "Email", v: selected.user_email || "unassigned" },
+ { k: "Email", v: selected.user_email || },
{ k: "Plan", v: selected.plan_name || `Plan #${selected.plan_id}` },
{ k: "Category", v: formatPaymentPlanCategory(selected.plan_category) },
- { k: "Transaction", v: selected.transaction_id || "unassigned", mono: true },
- { k: "Session", v: selected.session_id || "unassigned", mono: true },
+ { k: "Transaction", v: selected.transaction_id || , mono: true },
+ { k: "Session", v: selected.session_id || , mono: true },
{ k: "Subscription", v: `#${selected.subscription_id}` },
{ k: "Paid", v: formatPaymentDate(selected.paid_at ?? selected.created_at) },
...(selected.expires_at ? [{ k: "Expires", v: formatPaymentDate(selected.expires_at) }] : []),
diff --git a/src/pages/team/TeamManagementPage.tsx b/src/pages/team/TeamManagementPage.tsx
index f38adce..73cccbf 100644
--- a/src/pages/team/TeamManagementPage.tsx
+++ b/src/pages/team/TeamManagementPage.tsx
@@ -32,6 +32,7 @@ import { toast } from "sonner";
import { InviteTeamMemberDialog } from "../role-management/components/InviteTeamMemberDialog";
import { EXPORT_PERMISSIONS, EXPORT_ROUTES } from "../../lib/csv-export";
import { teamMemberExportQuery } from "../../lib/csvExportFilters";
+import { UnassignedLabel } from "../../lib/displayValue"
function formatDate(dateStr: string): string {
return new Date(dateStr).toLocaleDateString("en-US", {
@@ -388,10 +389,10 @@ export function TeamManagementPage() {
- {member.department || "unassigned"}
+ {member.department || }
- {member.job_title || "unassigned"}
+ {member.job_title || }
{member.last_login ? (
@@ -406,7 +407,7 @@ export function TeamManagementPage() {
) : (
)}
diff --git a/src/pages/team/TeamMemberDetailPage.tsx b/src/pages/team/TeamMemberDetailPage.tsx
index bd0bbe2..2c06dea 100644
--- a/src/pages/team/TeamMemberDetailPage.tsx
+++ b/src/pages/team/TeamMemberDetailPage.tsx
@@ -20,7 +20,7 @@ import { Separator } from "../../components/ui/separator"
import { cn } from "../../lib/utils"
import { notifyApiError } from "../../lib/apiErrors"
import { formatTeamRoleLabel } from "../../lib/teamRoles"
-import { displayValue, NOT_ASSIGNED_LABEL } from "../../lib/displayValue"
+import { DisplayValue, NOT_ASSIGNED_LABEL, UnassignedLabel, displayValue, isUnassignedLabel } from "../../lib/displayValue"
import { getTeamMemberById, updateTeamMemberStatus } from "../../api/team.api"
import type { TeamMemberDetail } from "../../types/team.types"
import { ActivityLogListPanel } from "../user-log/components/ActivityLogListPanel"
@@ -132,22 +132,26 @@ function LoadingSkeleton() {
)
}
-function InfoItem({ label, value }: { label: string; value: string }) {
+function InfoItem({ label, value }: { label: string; value: React.ReactNode }) {
return (
{label}
- {value}
+
+ {typeof value === "string" && isUnassignedLabel(value) ? : value}
+
)
}
-function InfoRow({ label, value }: { label: string; value: string }) {
+function InfoRow({ label, value }: { label: string; value: React.ReactNode }) {
return (
{label}
- {value}
+
+ {typeof value === "string" && isUnassignedLabel(value) ? : value}
+
)
}
@@ -159,7 +163,7 @@ function ContactField({
}: {
icon: React.ComponentType<{ className?: string }>
label: string
- value: string
+ value: React.ReactNode
}) {
return (
@@ -170,7 +174,9 @@ function ContactField({
{label}
- {value}
+
+ {typeof value === "string" && isUnassignedLabel(value) ? : value}
+
)
@@ -312,7 +318,7 @@ export function TeamMemberDetailPage() {
{fullName}
- {displayValue(member.job_title)}
+
-
-
+ } />
+ } />
@@ -383,8 +389,8 @@ export function TeamMemberDetailPage() {
-
-
+ } />
+ } />
- {logs[0]?.created_at ? getRelativeActivityTime(logs[0].created_at) : "unassigned"}
+ {logs[0]?.created_at ? getRelativeActivityTime(logs[0].created_at) : }
Latest on this page
@@ -450,7 +451,7 @@ export function ActivityLogListPanel({
scrollable ? "whitespace-nowrap" : "max-w-[280px] truncate",
)}
>
- {log.message || "unassigned"}
+ {log.message || }
{showActorColumn ? (
@@ -583,7 +584,7 @@ export function ActivityLogListPanel({
icon={}
label="Role"
value={
- selectedLog.actor_role ? formatRoleLabel(selectedLog.actor_role) : "unassigned"
+ selectedLog.actor_role ? formatRoleLabel(selectedLog.actor_role) :
}
/>
}
label="IP address"
- value={selectedLog.ip_address || "unassigned"}
+ value={selectedLog.ip_address || }
/>
}
label="User agent"
value={
- selectedLog.user_agent ? truncateUA(selectedLog.user_agent) : "unassigned"
+ selectedLog.user_agent ? truncateUA(selectedLog.user_agent) :
}
title={selectedLog.user_agent ?? undefined}
/>
diff --git a/src/pages/user-management/DeletionRequestsPage.tsx b/src/pages/user-management/DeletionRequestsPage.tsx
index a83042a..513899b 100644
--- a/src/pages/user-management/DeletionRequestsPage.tsx
+++ b/src/pages/user-management/DeletionRequestsPage.tsx
@@ -27,6 +27,7 @@ import type {
} from "../../types/user.types"
import type { Role } from "../../types/rbac.types"
import { mapDeletionRequestApiItem } from "../../types/user.types"
+import { UnassignedLabel } from "../../lib/displayValue"
const stateBadge: Record = {
PENDING: "bg-amber-100 text-amber-700",
@@ -542,21 +543,21 @@ export function DeletionRequestsPage() {
{item.first_name} {item.last_name}
{item.email}
- {item.phone_number || "unassigned"}
+ {item.phone_number || }
- {item.role || "unassigned"}
- {item.status || "unassigned"}
+ {item.role || }
+ {item.status || }
- {item.deletion_requested_at || "unassigned"}
+ {item.deletion_requested_at || }
- {item.deletion_scheduled_at || "unassigned"}
+ {item.deletion_scheduled_at || }
- {item.deletion_state || "unassigned"}
+ {item.deletion_state || }
diff --git a/src/pages/user-management/UserDetailPage.tsx b/src/pages/user-management/UserDetailPage.tsx
index 1e50681..6b7fb4f 100644
--- a/src/pages/user-management/UserDetailPage.tsx
+++ b/src/pages/user-management/UserDetailPage.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from "react";
+import { useEffect, useState, type ReactNode } from "react";
import {
ArrowLeft,
BookOpen,
@@ -35,7 +35,7 @@ import type { UserLearningActivityData, UserSubscriptionsData } from "../../type
import { UserLearningActivitySection } from "./components/UserLearningActivitySection";
import { UserAccountActivitySection } from "./components/UserAccountActivitySection";
import { UserSubscriptionsSection } from "./components/UserSubscriptionsSection";
-import { displayValue, NOT_ASSIGNED_LABEL } from "../../lib/displayValue";
+import { DisplayValue, NOT_ASSIGNED_LABEL, UnassignedLabel, displayValue, isUnassignedLabel } from "../../lib/displayValue"
const activityIcons = {
completed: CheckCircle2,
@@ -413,9 +413,9 @@ export function UserDetailPage() {
-
+ } />
-
+ } />
@@ -439,7 +439,7 @@ export function UserDetailPage() {
/>
}
/>
@@ -467,11 +467,11 @@ export function UserDetailPage() {
-
+ } />
-
-
-
+ } />
+ } />
+ } />
@@ -598,20 +598,24 @@ export function UserDetailPage() {
);
}
-function InfoItem({ label, value }: { label: string; value: string }) {
+function InfoItem({ label, value }: { label: string; value: ReactNode }) {
return (
{label}
- {value}
+
+ {typeof value === "string" && isUnassignedLabel(value) ? : value}
+
);
}
-function InfoRow({ label, value }: { label: string; value: string }) {
+function InfoRow({ label, value }: { label: string; value: ReactNode }) {
return (
{label}
- {value}
+
+ {typeof value === "string" && isUnassignedLabel(value) ? : value}
+
);
}
diff --git a/src/pages/user-management/UsersListPage.tsx b/src/pages/user-management/UsersListPage.tsx
index 695b9f0..cf6024f 100644
--- a/src/pages/user-management/UsersListPage.tsx
+++ b/src/pages/user-management/UsersListPage.tsx
@@ -26,6 +26,7 @@ import axios from "axios"
import { USER_FILTER_COUNTRIES, USER_FILTER_ETHIOPIA_REGIONS } from "../../data/userFilterLocations"
import { EXPORT_PERMISSIONS, EXPORT_ROUTES } from "../../lib/csv-export"
import { usersExportQuery } from "../../lib/csvExportFilters"
+import { UnassignedLabel } from "../../lib/displayValue"
function formatJoinedAt(iso: string): string {
if (!iso?.trim()) return "unassigned"
@@ -365,7 +366,7 @@ export function UsersListPage() {
const hasPhone = Boolean(phone?.trim())
const hasEmail = Boolean(email?.trim())
if (!hasPhone && !hasEmail) {
- return unassigned
+ return
}
return (
@@ -665,8 +666,8 @@ export function UsersListPage() {
{renderContactDetails(u.phoneNumber, u.email)}
- {u.country || "unassigned"}
- {u.region || "unassigned"}
+ {u.country || }
+ {u.region || }
{formatJoinedAt(u.createdAt)}
diff --git a/src/pages/user-management/components/UserSubscriptionsSection.tsx b/src/pages/user-management/components/UserSubscriptionsSection.tsx
index e22d16b..731080f 100644
--- a/src/pages/user-management/components/UserSubscriptionsSection.tsx
+++ b/src/pages/user-management/components/UserSubscriptionsSection.tsx
@@ -12,7 +12,7 @@ import {
TableRow,
} from "../../../components/ui/table"
import { useTeamPermissions } from "../../../hooks/useTeamPermissions"
-import { displayValue, NOT_ASSIGNED_LABEL } from "../../../lib/displayValue"
+import { DisplayValue, NOT_ASSIGNED_LABEL, displayValue } from "../../../lib/displayValue"
import {
formatAdminPaymentMethod,
hasSubscriptionAdminPermission,
@@ -559,7 +559,7 @@ export function UserSubscriptionsSection({
{recentPayments.map((payment) => (
- {displayValue(payment.plan_name)}
+
{formatMoney(payment.amount, payment.currency)}
|