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:
@@ -256,7 +256,7 @@ const featureList = data.features || data.services || [];
|
|||||||
|
|
||||||
<div class="service-stack">
|
<div class="service-stack">
|
||||||
{data.services.map((s: any, idx: number) => (
|
{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-num">0{idx + 1}</div>
|
||||||
<div class="service-stack-icon">
|
<div class="service-stack-icon">
|
||||||
<Icon name={s.icon as any} size={32} />
|
<Icon name={s.icon as any} size={32} />
|
||||||
@@ -264,7 +264,7 @@ const featureList = data.features || data.services || [];
|
|||||||
<div class="service-stack-body">
|
<div class="service-stack-body">
|
||||||
<h3 class="service-stack-title">{s.title}</h3>
|
<h3 class="service-stack-title">{s.title}</h3>
|
||||||
<ul class="service-stack-bullets">
|
<ul class="service-stack-bullets">
|
||||||
{s.bullets.map((b: string) => <li>{b}</li>)}
|
{(s.bullets || s.items || []).map((b: string) => <li>{b}</li>)}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user