import type { SiteLocale } from '~/types/locale' import { toContentLocale } from '~/types/locale' type SiteLang = SiteLocale const assessmentReportsLabels: Record> = { yes: { zh: '是,我有近期报告/影像', en: 'Yes, I have recent reports/scans' }, no: { zh: '否,暂时没有', en: 'No, not yet' }, pending: { zh: '我即将获取', en: 'I will obtain them soon' } } const partnerCategoryLabels: Record> = { 'medical-institution': { zh: '医疗机构', en: 'Medical Institution' }, 'referral-partner': { zh: '转诊合作伙伴', en: 'Referral Partner' }, 'travel-concierge': { zh: '旅行服务', en: 'Travel & Concierge' }, insurance: { zh: '保险', en: 'Insurance' }, other: { zh: '其他', en: 'Other' } } const langLabels: Record = { en: 'English', zh: '中文', ar: 'العربية', ru: 'Русский' } export function formatAssessmentReports(value: string | null | undefined, lang: SiteLang): string { const contentLang = toContentLocale(lang) if (!value) return contentLang === 'zh' ? '(未选择)' : '(Not selected)' return assessmentReportsLabels[value]?.[contentLang] ?? value } export function formatPartnerCategory(value: string, lang: SiteLang): string { return partnerCategoryLabels[value]?.[toContentLocale(lang)] ?? value } export function formatLangLabel(lang: SiteLang): string { return langLabels[lang] ?? lang } export function formatOptional(value: string | null | undefined, lang: SiteLang): string { const trimmed = value?.trim() if (trimmed) return trimmed return toContentLocale(lang) === 'zh' ? '(未填写)' : '(Not provided)' }