<template>
    <v-snackbar :color="color" :timeout="timeout" v-model="snackbar">
      {{ message }}
      <template v-slot:actions>
        <v-btn
          color="white"
          variant="text"
          @click="snackbar = false"
        >
          Close
        </v-btn>
      </template>
    </v-snackbar>
  </template>
  
  <script>
  export default {
    expose: ['showMessage'],
    data() {
      return {
        snackbar: false,
        message: '',
        color: 'success', // Change this to customize the snackbar color
        timeout: 6000,    // Change this to customize the snackbar timeout
      };
    },
    methods: {
      showMessage(message, status) {
        this.message = message;
        this.snackbar = true;
        if (status === 'Success') {
          this.color = 'success'
        } else {
          this.color = 'error'
        }
      },
    },
  };
  </script>
  