/ src / modals / ErrorModal.svelte
ErrorModal.svelte
 1  <script lang="ts">
 2    import config from "@app/lib/config";
 3  
 4    import Command from "@app/components/Command.svelte";
 5    import ExternalLink from "@app/components/ExternalLink.svelte";
 6    import IconLarge from "@app/components/IconLarge.svelte";
 7    import Modal from "@app/components/Modal.svelte";
 8  
 9    export let title: string;
10    export let subtitle: string[];
11    // This is more explicit than the standard error type.
12    export let error: { message: string; stack?: string };
13  </script>
14  
15  <Modal {title}>
16    <IconLarge name="alert" slot="icon" />
17  
18    <div slot="subtitle">
19      {@html subtitle.join("<br />")}
20  
21      <br />
22      <br />
23      If you need help resolving this issue, copy the error message
24      <br />
25      below and send it to us on
26      <ExternalLink href={config.supportWebsite}>
27        {config.supportWebsite}
28      </ExternalLink>
29    </div>
30  
31    <div slot="body">
32      <div style:max-width="28rem">
33        <Command command={JSON.stringify(error)} fullWidth showPrompt={false} />
34      </div>
35    </div>
36  </Modal>