/ src / components / jet / shelf / ProductRatingsShelf.svelte
ProductRatingsShelf.svelte
 1  <script lang="ts" context="module">
 2      import { type Ratings, type Shelf } from '@jet-app/app-store/api/models';
 3  
 4      interface ProductRatingsShelf extends Shelf {
 5          items: Ratings[];
 6      }
 7  
 8      export function isProductRatingsShelf(
 9          shelf: Shelf,
10      ): shelf is ProductRatingsShelf {
11          let { contentType, items } = shelf;
12  
13          return contentType === 'productRatings' && Array.isArray(items);
14      }
15  </script>
16  
17  <script lang="ts">
18      import ShelfItemLayout from '~/components/ShelfItemLayout.svelte';
19      import ProductRatingsItem from '~/components/jet/item/ProductRatingsItem.svelte';
20      import ShelfWrapper from '~/components/Shelf/Wrapper.svelte';
21  
22      export let shelf: ProductRatingsShelf;
23  </script>
24  
25  <ShelfWrapper {shelf} withBottomPadding={false}>
26      <ShelfItemLayout {shelf} gridType="A" let:item>
27          <ProductRatingsItem {item} />
28      </ShelfItemLayout>
29  </ShelfWrapper>