-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathCard.vue
32 lines (30 loc) · 1.09 KB
/
Card.vue
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
<script setup lang="ts">
import { PropType } from "vue"
import { formatUptime } from "~~/utils/function"
import { ParsedContent } from "@nuxt/content/dist/runtime/types"
const props = defineProps({
meta_data: Object as PropType<ParsedContent>,
report_data: Object as PropType<ParsedContent>,
})
const status = ref()
</script>
<template>
<div class="my-8 md:my-10 w-full">
<div class="mb-4 flex items-center justify-between">
<div class="mx-0.5 truncate">
<div class="flex items-center">
<StatusIcon :uptime="status?.overallUptime"></StatusIcon>
<NuxtLink :to="meta_data._path" class="ml-2 md:text-xl">{{ meta_data.title }}</NuxtLink>
</div>
<h4 class="text-sm text-gray-400">{{ meta_data.url }}</h4>
</div>
<div>
<p v-if="status?.overallUptime" class="ml-3 md:text-xl text-gray-400">
{{ formatUptime(status?.overallUptime) }}
</p>
<div v-else class="bg-gray-100 rounded-lg w-24 h-7 animate-pulse"></div>
</div>
</div>
<StatusGrid ref="status" :data="report_data?.body" />
</div>
</template>