forked from
npmx.dev/npmx.dev
[READ-ONLY]
a fast, modern browser for the npm registry
1<script setup lang="ts">
2import type { BuildInfo } from '#shared/types'
3
4const { footer = false, buildInfo: buildInfoProp } = defineProps<{
5 footer?: boolean
6 buildInfo?: BuildInfo
7}>()
8
9const appConfig = useAppConfig()
10const buildInfo = computed(() => buildInfoProp || appConfig.buildInfo)
11const buildTime = computed(() => new Date(buildInfo.value.time))
12</script>
13
14<template>
15 <div
16 class="font-mono text-xs text-fg-muted flex items-center gap-2 motion-safe:animate-fade-in motion-safe:animate-fill-both"
17 :class="footer ? 'my-1 justify-center sm:justify-start' : 'mb-8 justify-center'"
18 style="animation-delay: 0.05s"
19 >
20 <i18n-t keypath="built_at" scope="global">
21 <DateTime :datetime="buildTime" year="numeric" month="short" day="numeric" />
22 </i18n-t>
23 <span>·</span>
24 <LinkBase
25 v-if="buildInfo.env === 'release'"
26 :to="`https://github.com/npmx-dev/npmx.dev/tag/v${buildInfo.version}`"
27 >
28 v{{ buildInfo.version }}
29 </LinkBase>
30 <span v-else class="tracking-wider">{{ buildInfo.env }}</span>
31
32 <template v-if="buildInfo.commit && buildInfo.branch !== 'release'">
33 <span>·</span>
34 <LinkBase :to="`https://github.com/npmx-dev/npmx.dev/commit/${buildInfo.commit}`">
35 {{ buildInfo.shortCommit }}
36 </LinkBase>
37 </template>
38 </div>
39</template>