| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  | <template> | 
					
						
							|  |  |  |   <div class="text-center"> | 
					
						
							| 
									
										
										
										
											2021-11-04 18:15:23 -08:00
										 |  |  |     <v-snackbar v-model="toastAlert.open" top :color="toastAlert.color" timeout="2000" @input="toastAlert.open = false"> | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  |       <v-icon dark left> | 
					
						
							|  |  |  |         {{ icon }} | 
					
						
							|  |  |  |       </v-icon> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       {{ toastAlert.title }} | 
					
						
							|  |  |  |       {{ toastAlert.text }} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       <template #action="{ attrs }"> | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |         <v-btn text v-bind="attrs" @click="toastAlert.open = false"> {{ $t('general.close') }} </v-btn> | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  |       </template> | 
					
						
							|  |  |  |     </v-snackbar> | 
					
						
							|  |  |  |     <v-snackbar | 
					
						
							|  |  |  |       content-class="py-2" | 
					
						
							|  |  |  |       dense | 
					
						
							|  |  |  |       bottom | 
					
						
							|  |  |  |       right | 
					
						
							|  |  |  |       :value="toastLoading.open" | 
					
						
							|  |  |  |       :timeout="-1" | 
					
						
							|  |  |  |       :color="toastLoading.color" | 
					
						
							|  |  |  |       @input="toastLoading.open = false" | 
					
						
							|  |  |  |     > | 
					
						
							|  |  |  |       <div class="d-flex flex-column align-center justify-start" @click="toastLoading.open = false"> | 
					
						
							|  |  |  |         <div class="mb-2 mt-0 text-subtitle-1 text-center"> | 
					
						
							|  |  |  |           {{ toastLoading.text }} | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |         <v-progress-linear indeterminate color="white darken-2"></v-progress-linear> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |     </v-snackbar> | 
					
						
							|  |  |  |   </div> | 
					
						
							|  |  |  | </template> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  | <script lang="ts"> | 
					
						
							|  |  |  | import { computed, defineComponent } from "@nuxtjs/composition-api"; | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  | import { toastAlert, toastLoading } from "~/composables/use-toast"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  | export default defineComponent({ | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  |   setup() { | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  |     const icon = computed(() => { | 
					
						
							|  |  |  |       switch (toastAlert.color) { | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  |         case "error": | 
					
						
							|  |  |  |           return "mdi-alert"; | 
					
						
							|  |  |  |         case "success": | 
					
						
							|  |  |  |           return "mdi-check-bold"; | 
					
						
							|  |  |  |         case "info": | 
					
						
							|  |  |  |           return "mdi-information-outline"; | 
					
						
							|  |  |  |         default: | 
					
						
							|  |  |  |           return "mdi-alert"; | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return { icon, toastAlert, toastLoading }; | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  |   }, | 
					
						
							| 
									
										
										
										
											2022-01-09 07:15:23 +01:00
										 |  |  | }); | 
					
						
							| 
									
										
										
										
											2021-08-07 15:12:25 -08:00
										 |  |  | </script> |