1<script>
2  export let classes = '';
3  export let errorStore;
4  let error;
5  errorStore.subscribe((_error) => {
6    if (_error) {
7      error = _error.toString();
8    } else {
9      error = false;
10    }
11  });
12</script>
13
14<style>
15  #error {
16    background: darkred;
17    color: white;
18    flex: 1;
19    padding: 10px;
20  }
21  .invisible {
22    display: none;
23  }
24  .visible {
25    display: block;
26  }
27</style>
28
29{#if error}
30  <div id="error" class={classes}>{error}</div>
31{/if}
32