This repository has been archived on 2025-11-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
trafficcue-client/src/lib/components/lnv/info/OpeningHours.svelte
Cfp f2348873fd
Some checks failed
TrafficCue CI / check (push) Successful in 26s
TrafficCue CI / build (push) Has been cancelled
style: add eslint and prettier
2025-06-22 17:53:32 +02:00

31 lines
686 B
Svelte

<script lang="ts">
import Badge from "$lib/components/ui/badge/badge.svelte";
import opening_hours from "opening_hours";
let { hours, lat, lon }: { hours: string; lat: number; lon: number } =
$props();
const oh = $derived.by(() => {
return new opening_hours(hours, {
lat,
lon,
address: {
country_code: "de", // Default to Germany, can be overridden if needed
state: "NRW", // Default to North Rhine-Westphalia, can be overridden if needed
},
});
});
</script>
<h3 class="text-lg font-bold mt-2">
Opening Hours
{#if oh.getState()}
<Badge>Open</Badge>
{:else}
<Badge variant="destructive">Closed</Badge>
{/if}
</h3>
<p>{hours}</p>
<!-- todo -->