frontend/app/components/preferences/stats.vue

42 lines
1.2 KiB
Vue
Raw Normal View History

<template>
<Card class="grid gap-3 text-sm max-w-sm">
<dl class="grid gap-3">
2025-12-09 22:32:22 +01:00
<div
v-for="[key, value] of data"
:key="key"
class="flex flex-row items-baseline justify-between gap-4 truncate"
>
<dt class="text-muted-foreground">{{ key }}</dt>
<dd class="font-mono" v-if="typeof value === 'string'">
{{ value }}
</dd>
<dd class="font-mono" v-else>
2025-12-09 22:32:22 +01:00
<component :is="value"/>
</dd>
</div>
</dl>
</Card>
</template>
<script lang="tsx" setup>
import type { VNode } from "vue";
2025-07-16 07:48:39 +02:00
import pkg from "~~/package.json";
import { Card } from "../ui/card";
const data: [string, string | VNode][] = [
["Version", pkg.version],
["Licence", pkg.license],
["Author", pkg.author.name],
[
"Repository",
<a
href={pkg.repository.url.replace("git+", "")}
target="_blank"
rel="noopener noreferrer"
>
{pkg.repository.url.replace("git+", "").replace("https://", "")}
</a>,
],
];
</script>