|
1 | 1 | <template> |
2 | | - <div class="p-4 flex gap-4"> |
3 | | - <div class="flex-shrink-0 flex"> |
4 | | - <a :href="link" class="self-center w-16 h-16 overflow-hidden rounded-2xl border border-fg/10 dark:border-fg/15"> |
5 | | - <slot name="icon"> |
6 | | - <ServiceBaseIcon v-if="icon" v-bind="icon" /> |
7 | | - </slot> |
8 | | - </a> |
9 | | - </div> |
10 | | - <div> |
11 | | - <h3 class="text-lg mt-1 font-semibold line-clamp-1 flex gap-2 items-center"> |
12 | | - <slot name="title"> |
13 | | - <a :href="link">{{ title }}</a> |
14 | | - </slot> |
15 | | - <slot v-if="props?.status" name="status"> |
16 | | - <ServiceBaseStatus :ping="data?.ping" /> |
17 | | - </slot> |
18 | | - </h3> |
| 2 | + <ClientOnly> |
| 3 | + <template #default> |
| 4 | + <div class="p-4 flex gap-4"> |
| 5 | + <div class="flex-shrink-0 flex"> |
| 6 | + <a :href="link" class="self-center w-16 h-16 overflow-hidden rounded-2xl border border-fg/10 dark:border-fg/15"> |
| 7 | + <slot name="icon"> |
| 8 | + <ServiceBaseIcon v-if="icon" v-bind="icon" /> |
| 9 | + </slot> |
| 10 | + </a> |
| 11 | + </div> |
| 12 | + <div> |
| 13 | + <h3 class="text-lg mt-1 font-semibold line-clamp-1 flex gap-2 items-center"> |
| 14 | + <slot name="title"> |
| 15 | + <a :href="link">{{ title }}</a> |
| 16 | + </slot> |
| 17 | + <slot v-if="props?.status" name="status"> |
| 18 | + <ServiceBaseStatus :ping="data?.ping" /> |
| 19 | + </slot> |
| 20 | + </h3> |
19 | 21 |
|
20 | | - <p class="text-sm text-fg-dimmed line-clamp-1"> |
21 | | - <slot name="description"> |
22 | | - {{ description }} |
23 | | - </slot> |
24 | | - </p> |
25 | | - </div> |
26 | | - </div> |
| 22 | + <p class="text-sm text-fg-dimmed line-clamp-1"> |
| 23 | + <slot name="description"> |
| 24 | + {{ description }} |
| 25 | + </slot> |
| 26 | + </p> |
| 27 | + </div> |
| 28 | + </div> |
| 29 | + </template> |
| 30 | + <template #fallback> |
| 31 | + <div class="p-4 flex gap-4"> |
| 32 | + <div class="flex-shrink-0 flex"> |
| 33 | + <div class="self-center w-16 h-16 overflow-hidden rounded-2xl border border-black/5 animate-pulse"> |
| 34 | + <div class="bg-fg-dimmed h-full w-full" /> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + <div> |
| 38 | + <h3 class="animate-pulse text-lg mt-1"> |
| 39 | + <span class="inline-block min-h-[1em] w-[110px] flex-auto cursor-wait bg-fg-dimmed align-middle opacity-50 rounded" /> |
| 40 | + </h3> |
| 41 | + <p class="animate-pulse text-sm text-black/50"> |
| 42 | + <span class="inline-block min-h-[1em] w-[160px] flex-auto cursor-wait bg-fg-dimmed align-middle opacity-50 rounded" /> |
| 43 | + </p> |
| 44 | + </div> |
| 45 | + </div> |
| 46 | + </template> |
| 47 | + </ClientOnly> |
27 | 48 | </template> |
28 | 49 |
|
29 | 50 | <script setup lang="ts"> |
|
0 commit comments