forked from doggodoge/bb-timer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoundary.svelte
51 lines (45 loc) · 992 Bytes
/
Boundary.svelte
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<script>
import pkg from "../package.json"
import { getContext } from "svelte"
export let error = null
const { styleable } = getContext("sdk")
const component = getContext("component")
$: styles = {
normal: {},
id: $component.id,
interactive: true
}
</script>
{#if $error}
<div class="error" use:styleable={styles}>
<b>There was an error running the "{pkg.name}" plugin:</b>
<div class="detail">
{$error}
</div>
</div>
{:else}
<slot />
{/if}
<style>
.error {
background: var(--spectrum-global-color-red-400);
color: white;
border-radius: 4px;
padding: 16px;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
gap: 8px;
min-width: 400px;
}
.detail {
font-family: monospace;
font-size: 10px;
padding: 8px;
background: rgba(0, 0, 0, 0.1);
border-radius: 4px;
max-height: 100px;
overflow: auto;
}
</style>