<script setup lang="ts">
import { useSnackbar } from '@KTXC/composables/useSnackbar'

const {
  snackbarVisible,
  snackbarMessage,
  snackbarColor,
  snackbarTimeout,
  hideSnackbar,
} = useSnackbar()
</script>

<template>
  <v-snackbar
    :model-value="snackbarVisible"
    :color="snackbarColor"
    :timeout="snackbarTimeout"
    location="bottom right"
    @update:model-value="value => !value && hideSnackbar()"
  >
    {{ snackbarMessage }}

    <template #actions>
      <v-btn variant="text" @click="hideSnackbar()">
        Close
      </v-btn>
    </template>
  </v-snackbar>
</template>