From 632850b8d589791f14ffb07956e334c710fb4f10 Mon Sep 17 00:00:00 2001
From: 7222e800-c703-472d-a787-71b6b5cba4ef <mem@estrogen.zone>
Date: Sun, 14 Sep 2025 17:27:51 +0000
Subject: draft: initial work

---
 src/lib/Itinerary.svelte | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 src/lib/Itinerary.svelte

(limited to 'src/lib/Itinerary.svelte')

diff --git a/src/lib/Itinerary.svelte b/src/lib/Itinerary.svelte
new file mode 100644
index 0000000..fb30d1b
--- /dev/null
+++ b/src/lib/Itinerary.svelte
@@ -0,0 +1,36 @@
+<script lang="ts">
+  import type { Itinerary } from '$lib/motis-types';
+  import { normalisePlaceName } from './aliases';
+  let { itinerary }: { itinerary: Itinerary | null } = $props();
+
+  let legs = $derived(itinerary?.legs);
+  let firstLeg = $derived(legs?.[0]);
+  let lastLeg = $derived(legs?.[legs.length - 1]);
+</script>
+
+<svelte:head>
+  {#if itinerary && legs && firstLeg && lastLeg}
+    <meta name="itinerary:start" content={`${itinerary.startTime}`} />
+    <meta name="itinerary:end" content={`${itinerary.endTime}`} />
+    <meta name="itinerary:duration" content={`${itinerary.duration}`} />
+    <meta name="itinerary:transfers" content={`${itinerary.transfers}`} />
+    <meta name="itinerary:from:id" content={`${firstLeg.from.stopId}`} />
+    <meta
+      name="itinerary:from:name"
+      content={`${normalisePlaceName(firstLeg.from.name)}`}
+    />
+    <meta name="itinerary:to:id" content={`${lastLeg.to.stopId}`} />
+    <meta
+      name="itinerary:to:name"
+      content={`${normalisePlaceName(lastLeg.to.name)}`}
+    />
+  {/if}
+</svelte:head>
+
+<div class="flex flex-col gap-2 max-w-[100%]">
+  {#each legs ?? [] as leg}
+    <div class="p-4 pr-3 sm:pr-4 md:p-6 md:pr-6 rounded-xl bg-[#28282C]">
+      {JSON.stringify(leg)}
+    </div>
+  {/each}
+</div>
-- 
cgit v1.2.3

