summaryrefslogtreecommitdiff
path: root/src/components/jet/shelf/SmallBreakoutShelf.svelte
blob: 095cf7ff05827e338ec616b6761a31422a20c504 (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 {
        LargeHeroBreakout,
        Shelf,
        SmallBreakout,
    } from '@jet-app/app-store/api/models';

    interface SmallBreakoutShelf extends Shelf {
        items: SmallBreakout[];
    }

    export function isSmallBreakoutShelf(
        shelf: Shelf,
    ): shelf is SmallBreakoutShelf {
        const { contentType, items } = shelf;
        return contentType === 'smallBreakout' && Array.isArray(items);
    }
</script>

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

    export let shelf: SmallBreakoutShelf;
</script>

<ShelfWrapper {shelf}>
    <ShelfItemLayout {shelf} gridType="Spotlight" let:item>
        <SmallBreakoutItem {item} />
    </ShelfItemLayout>
</ShelfWrapper>