master
svelte 30 lines 740 Bytes
Raw
1 <script lang="ts">
2 import { notifications } from "./notifications";
3 import Notification from "./Notification.svelte";
4
5 export let hidden = false;
6 </script>
7
8 <div id="notifications" class:hidden>
9 {#if $notifications.length == 0}
10 <span class="empty">You have no notifications</span>
11 {:else}
12 {#each $notifications as notification}
13 <Notification id={notification.id} type={notification.type} title={notification.title} message={notification.message} read={notification.read} actions={notification.actions}></Notification>
14 {/each}
15 {/if}
16 </div>
17
18 <style lang="scss">
19 #notifications {
20 height: calc(100% - 1.5rem);
21 padding: 5px;
22 overflow: auto;
23 }
24 .empty {
25 color: #8c8c8c;
26 }
27 .hidden {
28 display: none;
29 }
30 </style>