Updated data loading strategy on world page
This commit is contained in:
21
app/components/global/card/Add.vue
Normal file
21
app/components/global/card/Add.vue
Normal file
@@ -0,0 +1,21 @@
|
||||
<script lang="ts" setup>
|
||||
import { PhPlusCircle } from "@phosphor-icons/vue";
|
||||
|
||||
const emit = defineEmits(["on-click"])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UiCard
|
||||
class="h-full lg:w-fit transition-all bg-transparent hover:text-slate-900 text-slate-500 dark:hover:text-slate-100 dark:text-slate-500 dark:focus-within:outline-gray-900 hover:-translate-y-0"
|
||||
has-click
|
||||
@on-click="emit('on-click')"
|
||||
>
|
||||
<UiCardHeader class="h-full justify-center items-center text-center gap-0">
|
||||
<PhPlusCircle size="38" weight="fill" />
|
||||
|
||||
<UiCardTitle class="text-xl">
|
||||
<slot />
|
||||
</UiCardTitle>
|
||||
</UiCardHeader>
|
||||
</UiCard>
|
||||
</template>
|
||||
22
app/components/global/card/Error.vue
Normal file
22
app/components/global/card/Error.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<script lang="ts" setup>
|
||||
import { PhCloudX } from '@phosphor-icons/vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UiCard class="w-full h-full flex flex-col border-rose-200 bg-rose-50 dark:border-rose-900 dark:bg-rose-950">
|
||||
<template v-if="$slots.title">
|
||||
<UiCardHeader class="flex-row items-center gap-2">
|
||||
<PhCloudX :size="32"/>
|
||||
|
||||
<UiCardTitle>
|
||||
<slot name="title" />
|
||||
</UiCardTitle>
|
||||
</UiCardHeader>
|
||||
</template>
|
||||
<template v-if="$slots.content">
|
||||
<UiCardContent class="grow grid gap-2">
|
||||
<slot name="content" />
|
||||
</UiCardContent>
|
||||
</template>
|
||||
</UiCard>
|
||||
</template>
|
||||
21
app/components/global/card/Loading.vue
Normal file
21
app/components/global/card/Loading.vue
Normal file
@@ -0,0 +1,21 @@
|
||||
<script lang="ts" setup>
|
||||
const { lineNb = 3 } = defineProps<{
|
||||
lineNb?: number
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UiCard class="w-full h-full flex flex-col">
|
||||
<UiCardHeader>
|
||||
<UiCardTitle>
|
||||
<UiSkeleton class="w-2/3 max-w-full h-8" />
|
||||
</UiCardTitle>
|
||||
</UiCardHeader>
|
||||
<UiCardContent class="grow grid gap-2">
|
||||
<UiSkeleton class="w-full max-w-full h-6" />
|
||||
<template v-for="(l, i) in lineNb" :key="i">
|
||||
<UiSkeleton class="max-w-full h-6" :style="`width: ${Math.floor(Math.random() * 100) + 1}%`" />
|
||||
</template>
|
||||
</UiCardContent>
|
||||
</UiCard>
|
||||
</template>
|
||||
Reference in New Issue
Block a user