forked from npmx-dev/npmx.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildEnvironment.vue
More file actions
47 lines (43 loc) · 1.45 KB
/
BuildEnvironment.vue
File metadata and controls
47 lines (43 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script setup lang="ts">
import type { BuildInfo } from '#shared/types'
const { footer = false, buildInfo: buildInfoProp } = defineProps<{
footer?: boolean
buildInfo?: BuildInfo
}>()
const { locale } = useI18n()
const appConfig = useAppConfig()
const buildInfo = computed(() => buildInfoProp || appConfig.buildInfo)
</script>
<template>
<div
class="font-mono text-xs text-fg-muted flex items-center gap-2 motion-safe:animate-fade-in motion-safe:animate-fill-both"
:class="footer ? 'my-1 justify-center sm:justify-start' : 'mb-8 justify-center'"
style="animation-delay: 0.05s"
>
<i18n-t keypath="built_at" scope="global">
<NuxtTime :datetime="buildInfo.time" :locale="locale" relative />
</i18n-t>
<span>·</span>
<NuxtLink
v-if="buildInfo.env === 'release'"
external
:href="`https://github.com/npmx-dev/npmx.dev/tag/v${buildInfo.version}`"
target="_blank"
class="hover:text-fg transition-colors"
>
v{{ buildInfo.version }}
</NuxtLink>
<span v-else class="tracking-wider">{{ buildInfo.env }}</span>
<template v-if="buildInfo.commit && buildInfo.branch !== 'release'">
<span>·</span>
<NuxtLink
external
:href="`https://github.com/npmx-dev/npmx.dev/commit/${buildInfo.commit}`"
target="_blank"
class="hover:text-fg transition-colors"
>
{{ buildInfo.shortCommit }}
</NuxtLink>
</template>
</div>
</template>