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

    interface InAppPurchaseLockupShelf extends Shelf {
        items: InAppPurchaseLockup[];
    }

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

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

    export let shelf: InAppPurchaseLockupShelf;
</script>

<ShelfWrapper {shelf}>
    <ShelfItemLayout {shelf} gridType="InAppPurchaseLockup" let:item>
        <InAppPurchaseLockupComponent {item} />
    </ShelfItemLayout>
</ShelfWrapper>