summaryrefslogtreecommitdiff
path: root/src/components/jet/shelf/LargeImageLockupShelf.svelte
blob: fd192fbfb04aad8c493321325ba44e42e7781d6a (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
29
30
<script lang="ts" context="module">
    import type { Shelf, ImageLockup } from '@jet-app/app-store/api/models';

    interface LargeImageLockupShelf extends Shelf {
        items: ImageLockup[];
    }

    export function isLargeImageLockupShelf(
        shelf: Shelf,
    ): shelf is LargeImageLockupShelf {
        return (
            shelf.contentType === 'largeImageLockup' &&
            Array.isArray(shelf.items)
        );
    }
</script>

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

    export let shelf: LargeImageLockupShelf;
</script>

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