fix(services/[slug]): handle missing bullets/items fields in legacy data

ai-consult service has data.services[i].items (not .bullets), so .map(bullets) crashed during build. Use s.bullets || s.items || [] fallback. Also data-surface defaults to 'white' when missing.
This commit is contained in:
Kunthawat Greethong
2026-06-11 08:52:42 +07:00
parent dcd1d73f56
commit c334b8b650

View File

@@ -256,7 +256,7 @@ const featureList = data.features || data.services || [];
<div class="service-stack">
{data.services.map((s: any, idx: number) => (
<div class="service-stack-item" data-surface={s.surface}>
<div class="service-stack-item" data-surface={s.surface || 'white'}>
<div class="service-stack-num">0{idx + 1}</div>
<div class="service-stack-icon">
<Icon name={s.icon as any} size={32} />
@@ -264,7 +264,7 @@ const featureList = data.features || data.services || [];
<div class="service-stack-body">
<h3 class="service-stack-title">{s.title}</h3>
<ul class="service-stack-bullets">
{s.bullets.map((b: string) => <li>{b}</li>)}
{(s.bullets || s.items || []).map((b: string) => <li>{b}</li>)}
</ul>
</div>
</div>