summaryrefslogtreecommitdiff
path: root/src/components/jet/shelf/ReviewsShelf.svelte
blob: 8304444a1a2cf280f5b0d9afe70654083d07c7c3 (plain)
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
<script lang="ts" context="module">
    import type {
        Shelf,
        Review as ReviewModel,
    } from '@jet-app/app-store/api/models';

    export interface ReviewsShelf extends Shelf {
        items: ReviewModel[];
    }

    export function isReviewsShelf(shelf: Shelf): shelf is ReviewsShelf {
        return shelf.contentType === 'reviews' && Array.isArray(shelf.items);
    }
</script>

<script lang="ts">
    import ShelfWrapper from '~/components/Shelf/Wrapper.svelte';
    import ShelfItemLayout from '~/components/ShelfItemLayout.svelte';
    import ReviewItem from '~/components/jet/item/ReviewItem.svelte';

    export let shelf: ReviewsShelf;
</script>

<ShelfWrapper {shelf}>
    <ShelfItemLayout {shelf} gridType="A" let:item>
        <ReviewItem {item} />
    </ShelfItemLayout>
</ShelfWrapper>