Added runtimeConfig and used it for appVersion in the footer

This commit is contained in:
Liviu Burcusel 2025-12-24 11:14:03 +01:00
parent 3897072e27
commit 52b255df65
Signed by: liviu
GPG key ID: 6CDB37A4AD2C610C
4 changed files with 30 additions and 4 deletions

View file

@ -14,7 +14,11 @@ import {
import { Separator } from "~/components/ui/separator";
import { useRuntimeConfig } from "#app";
const currentYear = new Date().getFullYear();
const config = useRuntimeConfig();
</script>
<template>
@ -40,8 +44,12 @@ const currentYear = new Date().getFullYear();
<slot />
</main>
<footer class="flex h-12 shrink-0 items-center gap-2 border-b px-4" data-testid="footer">
<div v-if="currentYear === 2025" class="bg-muted/50 flex-1 rounded-xl p-2 text-center">Glowing Fiesta 2025</div>
<div v-else class="bg-muted/50 flex-1 rounded-xl p-2 text-center">Glowing Fiesta 2025 - {{ currentYear }}</div>
<div v-if="currentYear === 2025" class="bg-muted/50 flex-1 rounded-xl p-2 text-center">
Glowing Fiesta 2025 <span class="text-muted-foreground">({{ config.public.appVersion }})</span>
</div>
<div v-else class="bg-muted/50 flex-1 rounded-xl p-2 text-center">
Glowing Fiesta 2025 - {{ currentYear }} <span class="text-muted-foreground">({{ config.public.appVersion }})</span>
</div>
</footer>
</SidebarInset>
</SidebarProvider>