2026-05-20 21:53:44 +00:00
|
|
|
|
<style scoped>
|
|
|
|
|
|
.error-notification {
|
2026-05-24 21:27:16 +00:00
|
|
|
|
background-color: #f8d7da;
|
|
|
|
|
|
border: 1px solid #f5c6cb;
|
|
|
|
|
|
border-radius: 0.375rem;
|
|
|
|
|
|
padding: 1rem 1.25rem;
|
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.75rem;
|
2026-05-20 21:53:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
.error-icon {
|
2026-05-24 21:27:16 +00:00
|
|
|
|
font-size: 1.25rem;
|
|
|
|
|
|
flex-shrink: 0;
|
2026-05-20 21:53:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
.error-text {
|
2026-05-24 21:27:16 +00:00
|
|
|
|
color: #721c24;
|
|
|
|
|
|
flex: 1;
|
2026-05-20 21:53:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
.error-dismiss {
|
2026-05-24 21:27:16 +00:00
|
|
|
|
background: none;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
color: #721c24;
|
|
|
|
|
|
font-size: 1.25rem;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
padding: 0 0.25rem;
|
|
|
|
|
|
line-height: 1;
|
|
|
|
|
|
opacity: 0.7;
|
2026-05-20 21:53:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
.error-dismiss:hover {
|
2026-05-24 21:27:16 +00:00
|
|
|
|
opacity: 1;
|
2026-05-20 21:53:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-05-24 21:27:16 +00:00
|
|
|
|
<div v-if="visible" class="error-notification" role="alert">
|
|
|
|
|
|
<span class="error-text">{{ message }}</span>
|
|
|
|
|
|
<button
|
|
|
|
|
|
v-if="dismissible"
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
class="error-dismiss"
|
|
|
|
|
|
aria-label="Dismiss error"
|
|
|
|
|
|
@click="dismiss"
|
|
|
|
|
|
>
|
|
|
|
|
|
×
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2026-05-20 21:53:44 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
|
|
|
|
const props = withDefaults(
|
2026-05-24 21:27:16 +00:00
|
|
|
|
defineProps<{
|
|
|
|
|
|
message?: string;
|
|
|
|
|
|
dismissible?: boolean;
|
|
|
|
|
|
}>(),
|
|
|
|
|
|
{
|
|
|
|
|
|
message:
|
|
|
|
|
|
"Something went wrong. Your request could not be completed. Please try again.",
|
|
|
|
|
|
dismissible: true,
|
|
|
|
|
|
},
|
2026-05-20 21:53:44 +00:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
2026-05-24 21:27:16 +00:00
|
|
|
|
dismissed: [];
|
2026-05-20 21:53:44 +00:00
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
const visible = ref(true);
|
|
|
|
|
|
|
|
|
|
|
|
function dismiss() {
|
2026-05-24 21:27:16 +00:00
|
|
|
|
visible.value = false;
|
|
|
|
|
|
emit("dismissed");
|
2026-05-20 21:53:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function show() {
|
2026-05-24 21:27:16 +00:00
|
|
|
|
visible.value = true;
|
2026-05-20 21:53:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
defineExpose({ show, dismiss });
|
|
|
|
|
|
</script>
|