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

46 lines
1.1 KiB
Vue
Raw Normal View History

<template>
2023-05-07 01:05:18 +02:00
<MkPagination :pagination="pagination">
<template #empty>
<div class="_fullinfo">
<img
src="/static-assets/badges/not-found.webp"
2023-05-07 01:05:18 +02:00
class="_ghost"
2023-05-07 02:43:11 +02:00
:alt="i18n.ts.notFound"
2023-05-07 01:05:18 +02:00
/>
<div>{{ i18n.ts.notFound }}</div>
</div>
</template>
2024-04-10 16:25:11 +02:00
<template #default="{ items }: { items: entities.Channel[] }">
2023-05-07 01:05:18 +02:00
<MkChannelPreview
v-for="item in items"
:key="item.id"
class="_margin"
:channel="extractor(item)"
/>
</template>
</MkPagination>
</template>
<script lang="ts" setup>
2024-04-11 23:55:54 +02:00
import type { entities } from "firefish-js";
2023-05-07 01:05:18 +02:00
import MkChannelPreview from "@/components/MkChannelPreview.vue";
import type { PagingOf } from "@/components/MkPagination.vue";
2023-07-17 00:32:32 +02:00
import MkPagination from "@/components/MkPagination.vue";
2023-05-07 01:05:18 +02:00
import { i18n } from "@/i18n";
2024-04-10 16:25:11 +02:00
withDefaults(
2023-05-07 01:05:18 +02:00
defineProps<{
pagination: PagingOf<entities.Channel>;
2023-05-07 01:05:18 +02:00
noGap?: boolean;
2024-04-10 16:25:11 +02:00
// TODO: this function is not used and may can be removed
extractor?: (item: entities.Channel) => entities.Channel;
2023-05-07 01:05:18 +02:00
}>(),
{
2024-04-10 16:25:11 +02:00
extractor: (item: entities.Channel) => item,
2023-07-06 03:28:27 +02:00
},
2023-05-07 01:05:18 +02:00
);
</script>
2023-05-07 01:05:18 +02:00
<style lang="scss" scoped></style>