54 lines
1.2 KiB
Vue
54 lines
1.2 KiB
Vue
<script setup lang="ts">
|
|
import { messages } from '../lib/messages'
|
|
|
|
defineProps<{ code: string; message: string; demoUrl?: string | null }>()
|
|
defineEmits<{ retry: [] }>()
|
|
</script>
|
|
|
|
<template>
|
|
<div class="error" role="alert" :data-error-code="code">
|
|
<p>{{ message }}</p>
|
|
<button type="button" @click="$emit('retry')">{{ messages.streamErrorRetry }}</button>
|
|
<a v-if="demoUrl" class="demo-link" :href="demoUrl">
|
|
{{ messages.streamErrorDemoInstance }}
|
|
</a>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.error {
|
|
padding-left: var(--s-5);
|
|
color: var(--c-error);
|
|
border-left: 2px solid var(--c-error);
|
|
}
|
|
|
|
.error p {
|
|
margin: 0;
|
|
text-wrap: pretty;
|
|
}
|
|
|
|
.error button {
|
|
min-height: var(--tap-min);
|
|
margin-top: var(--s-3);
|
|
padding: 8px var(--s-4);
|
|
color: var(--c-error);
|
|
font-family: var(--f-mono);
|
|
font-size: var(--t-micro);
|
|
background: transparent;
|
|
border: 1px solid currentcolor;
|
|
border-radius: var(--r-md);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.demo-link {
|
|
display: inline-block;
|
|
margin-top: var(--s-3);
|
|
margin-left: var(--s-3);
|
|
padding: 8px var(--s-4);
|
|
color: var(--c-text);
|
|
font-family: var(--f-mono);
|
|
font-size: var(--t-micro);
|
|
border: 1px solid var(--c-line-strong);
|
|
border-radius: var(--r-md);
|
|
}
|
|
</style>
|