268 lines
8.3 KiB
TypeScript
268 lines
8.3 KiB
TypeScript
import { aboutUsConcierge, aboutUsHero, aboutUsStory, aboutUsWhy } from '~/data/about-us-content'
|
|
import * as alipayPay from '~/data/alipay-pay-content'
|
|
import { casesClosing, casesPageHero, successStoryCases } from '~/data/cases-content'
|
|
import { newsClosing, newsPageHero } from '~/data/news-content'
|
|
import { coordinationServices } from '~/data/coordination-content'
|
|
import { medicalCentersByCity } from '~/data/cities-content'
|
|
import * as chinaHealthcare from '~/data/china-healthcare-foreigner-content'
|
|
import * as exploreVisaFree from '~/data/explore-china-visa-free-content'
|
|
import { faqHero, faqIntro, faqItems, faqPageTitle } from '~/data/faq-content'
|
|
import { siteVisibility } from '~/data/site-visibility'
|
|
import { freeAssessmentHero } from '~/data/free-assessment-content'
|
|
import {
|
|
healthScreeningsAdvantage,
|
|
healthScreeningsAdvantageBanner,
|
|
healthScreeningsClosing,
|
|
healthScreeningsDisclaimer,
|
|
healthScreeningsFaqGroups,
|
|
healthScreeningsFounder,
|
|
healthScreeningsFounderBanner,
|
|
healthScreeningsHero
|
|
} from '~/data/health-screenings-content'
|
|
import { healthScreeningsDropdown } from '~/data/health-screenings-nav'
|
|
import { doctors, hospitals } from '~/data/hospitals-content'
|
|
import { imcPackagesOverview } from '~/data/imc-packages-content'
|
|
import { infrastructureBottom, infrastructureTop } from '~/data/infrastructure-content'
|
|
import * as partnerWithUs from '~/data/partner-with-us-content'
|
|
import { patientGuideDropdown } from '~/data/patient-guide-nav'
|
|
import { processSteps } from '~/data/process-content'
|
|
import {
|
|
servicesClosing,
|
|
servicesFaq,
|
|
servicesHero,
|
|
servicesProcessBanner,
|
|
servicesProcessStages
|
|
} from '~/data/services-content'
|
|
import * as s1s2Visa from '~/data/s1-s2-visa-content'
|
|
import {
|
|
accessibilityMeta,
|
|
accessibilitySections
|
|
} from '~/data/accessibility-statement-content'
|
|
import { privacyPolicyMeta, privacyPolicySections } from '~/data/privacy-policy-content'
|
|
import {
|
|
termsOfUseIntro,
|
|
termsOfUseMeta,
|
|
termsOfUseSections
|
|
} from '~/data/terms-of-use-content'
|
|
import * as visaGuide from '~/data/visa-guide-content'
|
|
import * as wechatPay from '~/data/wechat-pay-content'
|
|
import * as whyChina from '~/data/why-china-content'
|
|
import { joinSearchText } from '~/utils/collect-text'
|
|
|
|
export type SiteSearchCategory =
|
|
| 'Page'
|
|
| 'Patient Guide'
|
|
| 'Hospital'
|
|
| 'Doctor'
|
|
| 'FAQ'
|
|
| 'Success Story'
|
|
| 'Health Screening'
|
|
| 'Legal'
|
|
|
|
export type SiteSearchEntry = {
|
|
id: string
|
|
title: string
|
|
url: string
|
|
category: SiteSearchCategory
|
|
body: string
|
|
}
|
|
|
|
function entry(
|
|
id: string,
|
|
title: string,
|
|
url: string,
|
|
category: SiteSearchCategory,
|
|
...textSources: unknown[]
|
|
): SiteSearchEntry {
|
|
return {
|
|
id,
|
|
title,
|
|
url,
|
|
category,
|
|
body: joinSearchText(title, ...textSources)
|
|
}
|
|
}
|
|
|
|
function patientGuideEntry(
|
|
slug: string,
|
|
title: string,
|
|
url: string,
|
|
module: Record<string, unknown>
|
|
): SiteSearchEntry {
|
|
return entry(`patient-guide:${slug}`, title, url, 'Patient Guide', module)
|
|
}
|
|
|
|
const staticPages: SiteSearchEntry[] = [
|
|
entry('page:home', 'Home', '/', 'Page', {
|
|
title: 'Medical Tourism China: Fast-Track Access to Advanced Specialized Care',
|
|
welcome: 'Welcome to UMedGlobal',
|
|
coordinationServices,
|
|
infrastructureTop,
|
|
infrastructureBottom,
|
|
medicalCentersByCity,
|
|
processSteps
|
|
}),
|
|
entry('page:services', 'Services', '/services', 'Page', servicesHero, servicesProcessBanner, servicesProcessStages, servicesFaq, servicesClosing),
|
|
entry('page:about-us', 'About us', '/about-us', 'Page', aboutUsHero, aboutUsStory, aboutUsConcierge, aboutUsWhy),
|
|
entry('page:cases', 'Success Story', '/cases', 'Page', casesPageHero, casesClosing),
|
|
entry('page:news', 'Media Center', '/news', 'Page', newsPageHero, newsClosing),
|
|
...(siteVisibility.showFaqPage
|
|
? [entry('page:faq', faqPageTitle, '/faq', 'Page', faqHero, faqIntro)]
|
|
: []),
|
|
entry('page:free-assessment', 'Get Free Assessment', '/free-assessment', 'Page', freeAssessmentHero),
|
|
entry('page:partner-with-us', 'Partner With US', '/partner-with-us', 'Page', partnerWithUs),
|
|
entry('page:hospitals', 'Featured Hospitals', '/hospitals', 'Page', {
|
|
title: 'Featured Hospitals',
|
|
desc: 'A curated network of JCI-accredited facilities and Grade 3A public hospitals in China.'
|
|
}),
|
|
entry('page:doctors', 'Featured Specialists', '/doctors', 'Page', {
|
|
title: 'Featured Specialists',
|
|
desc: 'Leading department heads and chief physicians across our partner hospital network in China.'
|
|
}),
|
|
entry(
|
|
'page:health-screenings',
|
|
'Health Screenings',
|
|
'/health-screenings',
|
|
'Page',
|
|
healthScreeningsHero,
|
|
healthScreeningsAdvantageBanner,
|
|
healthScreeningsAdvantage,
|
|
healthScreeningsFounderBanner,
|
|
healthScreeningsFounder,
|
|
healthScreeningsFaqGroups,
|
|
healthScreeningsDisclaimer,
|
|
healthScreeningsClosing
|
|
)
|
|
]
|
|
|
|
const patientGuides: SiteSearchEntry[] = [
|
|
patientGuideEntry(
|
|
'why-china',
|
|
'Why Choose China for Medical Tourism',
|
|
'/patient-guide/why-choose-china-for-medical-tourism',
|
|
whyChina as unknown as Record<string, unknown>
|
|
),
|
|
patientGuideEntry(
|
|
'visa-guide',
|
|
'China Medical Tourism Visa Guide',
|
|
'/patient-guide/china-medical-tourism-visa-guide',
|
|
visaGuide as unknown as Record<string, unknown>
|
|
),
|
|
patientGuideEntry(
|
|
's1-s2-visa',
|
|
'How To Get China Medical S1/s2 Visa',
|
|
'/patient-guide/how-to-get-china-medical-s1-s2-visa',
|
|
s1s2Visa as unknown as Record<string, unknown>
|
|
),
|
|
patientGuideEntry(
|
|
'visa-free',
|
|
'Explore China Visa-Free',
|
|
'/patient-guide/explore-china-visa-free',
|
|
exploreVisaFree as unknown as Record<string, unknown>
|
|
),
|
|
patientGuideEntry(
|
|
'healthcare-guide',
|
|
"China Healthcare: A Foreigner's Definitive Guide",
|
|
'/patient-guide/china-healthcare-a-foreigners-definitive-guide',
|
|
chinaHealthcare as unknown as Record<string, unknown>
|
|
),
|
|
patientGuideEntry(
|
|
'wechat-pay',
|
|
'Secure & Convenient WeChat Pay for Medical Tourism',
|
|
'/patient-guide/secure-convenient-wechat-pay-for-medical-tourism',
|
|
wechatPay as unknown as Record<string, unknown>
|
|
),
|
|
patientGuideEntry(
|
|
'alipay',
|
|
'How to Set Up & Use Alipay for Medical Tourism',
|
|
'/patient-guide/how-to-set-up-use-alipay-for-medical-tourism',
|
|
alipayPay as unknown as Record<string, unknown>
|
|
)
|
|
]
|
|
|
|
const legalPages: SiteSearchEntry[] = [
|
|
entry('legal:privacy', 'Privacy Policy', '/privacy-policy', 'Legal', privacyPolicyMeta, privacyPolicySections),
|
|
entry('legal:terms', 'Terms of Use', '/terms-of-use', 'Legal', termsOfUseMeta, termsOfUseIntro, termsOfUseSections),
|
|
entry(
|
|
'legal:accessibility',
|
|
'Accessibility Statement',
|
|
'/accessibility-statement',
|
|
'Legal',
|
|
accessibilityMeta,
|
|
accessibilitySections
|
|
)
|
|
]
|
|
|
|
const hospitalEntries: SiteSearchEntry[] = hospitals.map((h) =>
|
|
entry(`hospital:${h.id}`, h.name, `/hospitals`, 'Hospital', h.intro, h.name)
|
|
)
|
|
|
|
const doctorEntries: SiteSearchEntry[] = doctors.map((d) =>
|
|
entry(
|
|
`doctor:${d.id}`,
|
|
d.name,
|
|
`/doctors?hospital=${encodeURIComponent(d.hospitalId)}`,
|
|
'Doctor',
|
|
d.name,
|
|
d.department,
|
|
d.hospitalName,
|
|
d.expertLabel,
|
|
d.expertInfo
|
|
)
|
|
)
|
|
|
|
const faqEntries: SiteSearchEntry[] = siteVisibility.showFaqPage
|
|
? faqItems.map((item) =>
|
|
entry(`faq:${item.id}`, item.question, `/faq#${item.id}`, 'FAQ', item.question, item.blocks)
|
|
)
|
|
: []
|
|
|
|
const caseEntries: SiteSearchEntry[] = successStoryCases.map((c, i) =>
|
|
entry(`case:${i}`, c.title, '/cases', 'Success Story', c.title, c.blocks)
|
|
)
|
|
|
|
const healthScreeningEntries: SiteSearchEntry[] = [
|
|
...healthScreeningsDropdown.map((item) =>
|
|
entry(
|
|
`screening-nav:${item.to}`,
|
|
item.label,
|
|
item.to,
|
|
'Health Screening',
|
|
item.label,
|
|
healthScreeningsHero
|
|
)
|
|
),
|
|
...imcPackagesOverview.map((pkg) =>
|
|
entry(
|
|
`screening:${pkg.slug}`,
|
|
pkg.title,
|
|
pkg.to,
|
|
'Health Screening',
|
|
pkg.title,
|
|
pkg.packageCode,
|
|
pkg.ageNote,
|
|
pkg.prices,
|
|
pkg.highlights,
|
|
pkg.gynecologyNote
|
|
)
|
|
)
|
|
]
|
|
|
|
const navEntries: SiteSearchEntry[] = [
|
|
...patientGuideDropdown.map((item) =>
|
|
entry(`nav:${item.to}`, item.label, item.to, 'Patient Guide', item.label)
|
|
)
|
|
]
|
|
|
|
export const siteSearchIndex: SiteSearchEntry[] = [
|
|
...staticPages,
|
|
...patientGuides,
|
|
...legalPages,
|
|
...navEntries,
|
|
...hospitalEntries,
|
|
...doctorEntries,
|
|
...faqEntries,
|
|
...caseEntries,
|
|
...healthScreeningEntries
|
|
]
|