1import i18n from '../../i18n';
2
3const BVToastMixin = {
4  methods: {
5    successToast(message, title = i18n.t('global.response.success')) {
6      this.$root.$bvToast.toast(message, {
7        title,
8        variant: 'success',
9        autoHideDelay: 10000, //auto hide in milliseconds
10        isStatus: true,
11        solid: true
12      });
13    },
14    errorToast(message, title = i18n.t('global.response.error')) {
15      this.$root.$bvToast.toast(message, {
16        title,
17        variant: 'danger',
18        noAutoHide: true,
19        isStatus: true,
20        solid: true
21      });
22    },
23    warningToast(message, title = i18n.t('global.response.warning')) {
24      this.$root.$bvToast.toast(message, {
25        title,
26        variant: 'warning',
27        noAutoHide: true,
28        isStatus: true,
29        solid: true
30      });
31    }
32  }
33};
34
35export default BVToastMixin;
36