Skip to content

Commit

Permalink
chore: inlineNotification component
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-moore committed Jul 9, 2024
1 parent bd13a8e commit ab72e7e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions layer/components/InlineNotification.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<script setup lang="ts">
const emit = defineEmits<{
close: []
}>()
const timeoutId = setTimeout(() => {
closeNotification()
}, 7000)
function closeNotification() {
clearTimeout(timeoutId)
emit('close')
}
onUnmounted(() => {
clearTimeout(timeoutId)
})
</script>

<template>
<div
class="rounded-xl flex"
>
<p class="flex-1">
<slot />
</p>
<div class="items-start" @click="closeNotification">
<button>
<SharedIcon name="close" is-md />
</button>
</div>
</div>
</template>

0 comments on commit ab72e7e

Please sign in to comment.