Update to handle new serviceDetails object

This commit is contained in:
Fred Boniface 2024-04-23 14:58:27 +01:00
parent 1b21dacfd9
commit 2a615a822e
2 changed files with 7 additions and 9 deletions

View File

@ -61,7 +61,7 @@
{:else}
<div class="detailOperator"><StylesToc toc={service?.operator || ''} full={true} /></div>
<TrainIcons firstClass={serviceDetail.firstClass} hasCatering={serviceDetail.catering} sleeper={serviceDetail.sleeper} vstp={serviceDetail.vstp} />
<TrainIcons serviceDetails={serviceDetail.serviceDetails} />
{#if serviceDetail.pis}
<PisHandler pisObject={serviceDetail.pis} />
{/if}

View File

@ -1,35 +1,33 @@
<script lang="ts">
import Tooltip from "$lib/Tooltip.svelte";
import type { ServiceDetail } from "@owlboard/ts-types";
import { IconBed, IconSquare1, IconSquareLetterV, IconToolsKitchen2 } from "@tabler/icons-svelte";
export let firstClass: boolean
export let hasCatering: boolean
export let sleeper: boolean
export let vstp: boolean
export let serviceDetails: ServiceDetail
</script>
{#if firstClass}
{#if serviceDetails.firstClass}
<Tooltip text="First Class is available">
<IconSquare1 />
</Tooltip>
{/if}
{#if hasCatering}
{#if serviceDetails.catering}
<Tooltip text="Catering is available">
<IconToolsKitchen2 />
</Tooltip>
{/if}
{#if sleeper}
{#if serviceDetails.sleeper}
<Tooltip text="Sleeping Berths are available">
<IconBed />
</Tooltip>
{/if}
{#if vstp}
{#if serviceDetails.vstp}
<Tooltip text="This is a VSTP planned service">
<IconSquareLetterV />
</Tooltip>