From f0edf39d58d70ce7740cf6987acfe7ef93870920 Mon Sep 17 00:00:00 2001
From: sina_sajjadi
- {profile?.match_summary?.public_info.find( - (field) => field.key === "q1_full_name", - )?.value || "Name not available"} + {formatFieldValue( + profile?.match_summary?.public_info.find( + (field) => field.key === "q1_full_name", + )?.value ?? null, + ) || "Name not available"}
diff --git a/src/app/questions-list/[slug]/answer-pace-sheet.tsx b/src/app/questions-list/[slug]/answer-pace-sheet.tsx index 9995b5d..ce9f115 100644 --- a/src/app/questions-list/[slug]/answer-pace-sheet.tsx +++ b/src/app/questions-list/[slug]/answer-pace-sheet.tsx @@ -6,7 +6,7 @@ import { hasQuestionAnswerValue, } from "@/components/questions/question-answer-storage"; import InformationSheet from "@/components/ui/information-sheet"; -import type { MarriageField } from "@/hooks/marriage/types"; +import type { MarriageField, MarriagePhoneFieldValue } from "@/hooks/marriage/types"; import { useMarriageSectionsQuery } from "@/hooks/marriage/use-sections"; type AnswerPaceSheetProps = { @@ -34,7 +34,23 @@ function isMarriageField(value: unknown): value is MarriageField { (field.value === null || typeof field.value === "string" || typeof field.value === "number" || - typeof field.value === "boolean") + typeof field.value === "boolean" || + isMarriagePhoneFieldValue(field.value)) + ); +} + +function isMarriagePhoneFieldValue( + value: unknown, +): value is MarriagePhoneFieldValue { + if (!value || typeof value !== "object") { + return false; + } + + const phoneValue = value as Partial