File size: 798 Bytes
4d70170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<script lang="ts">
import { defineComponent } from 'vue'
import { useError } from '.'

export default defineComponent({
  setup() {
    const {
      error,
      clearError,
    } = useError()

    return {
      error,
      clearError,
    }
  },
})
</script>

<template>
  <div
    v-if="error"
    class="absolute bottom-0 left-0 right-0 flex justify-center pb-4"
  >
    <div class="flex items-center bg-red-200 text-red-600 dark:bg-red-800 dark:text-red-400 px-4 py-2 rounded space-x-4 shadow-md">
      <VueIcon
        :icon="error.icon || 'error'"
        class="w-6 h-6"
      />
      <div>
        {{ error.message }}
      </div>
      <VueButton
        class="icon-button flat danger"
        icon-left="close"
        @click="clearError()"
      />
    </div>
  </div>
</template>