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

    export interface PrivacyTypeShelf extends Shelf {
        items: PrivacyType[];
    }

    export function isPrivacyTypeShelf(
        shelf: Shelf,
    ): shelf is PrivacyTypeShelf {
        let { contentType, items } = shelf;

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

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

    export let shelf: PrivacyTypeShelf;
</script>

<ShelfWrapper {shelf} withBottomPadding={false}>
    <ShelfItemLayout {shelf} gridType="B" let:item>
        <PrivacyTypeItem {item} />
    </ShelfItemLayout>
</ShelfWrapper>