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

    interface ArcadeFooterShelf extends Shelf {
        items: [ArcadeFooter];
    }

    export function isArcadeFooterShelf(
        shelf: Shelf,
    ): shelf is ArcadeFooterShelf {
        const { contentType, items } = shelf;

        return contentType === 'arcadeFooter' && Array.isArray(items);
    }
</script>

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

    export let shelf: ArcadeFooterShelf;

    $: gridRows = shelf.rowsPerColumn ?? undefined;
    $: items = shelf.items;
</script>

<ShelfWrapper {shelf} withBottomPadding={false}>
    <HorizontalShelf {gridRows} gridType="Spotlight" {items} let:item>
        <ArcadeFooterItem {item} />
    </HorizontalShelf>
</ShelfWrapper>