hippofish/packages/client/src/components/MkUserList.vue

54 lines
1.2 KiB
Vue
Raw Normal View History

<template>
2023-04-08 02:01:42 +02:00
<MkPagination ref="pagingComponent" :pagination="pagination">
<template #empty>
<div class="_fullinfo">
<img
src="/static-assets/badges/info.webp"
2023-04-08 02:01:42 +02:00
class="_ghost"
alt="Info"
/>
<div>{{ i18n.ts.noUsers }}</div>
</div>
</template>
2024-04-12 10:37:32 +02:00
<template #default="{ items }: { items: entities.UserDetailed[] }">
2023-04-08 02:01:42 +02:00
<div class="efvhhmdq">
<MkUserInfo
2024-04-12 10:37:32 +02:00
v-for="user in items"
2023-04-08 02:01:42 +02:00
:key="user.id"
class="user"
:user="user"
/>
</div>
</template>
</MkPagination>
</template>
<script lang="ts" setup>
2023-04-08 02:01:42 +02:00
import { ref } from "vue";
import MkUserInfo from "@/components/MkUserInfo.vue";
2024-04-12 10:37:32 +02:00
import type {
MkPaginationType,
PagingKeyOf,
PagingOf,
} from "@/components/MkPagination.vue";
2023-09-02 01:27:33 +02:00
import MkPagination from "@/components/MkPagination.vue";
2023-04-08 02:01:42 +02:00
import { i18n } from "@/i18n";
2024-04-12 10:37:32 +02:00
import type { entities } from "firefish-js";
2023-10-31 12:19:05 +01:00
defineProps<{
2024-04-12 10:37:32 +02:00
pagination: PagingOf<entities.UserDetailed>;
noGap?: boolean;
}>();
2024-04-12 10:37:32 +02:00
const pagingComponent = ref<MkPaginationType<PagingKeyOf<entities.User>>>();
</script>
<style lang="scss" scoped>
.efvhhmdq {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
grid-gap: var(--margin);
}
</style>