| 
									
										
										
										
											2022-06-03 20:12:32 -08:00
										 |  |  | import { useContext } from "@nuxtjs/composition-api"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export interface ContextMenuItem { | 
					
						
							|  |  |  |   title: string; | 
					
						
							|  |  |  |   icon: string; | 
					
						
							|  |  |  |   event: string; | 
					
						
							|  |  |  |   color?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-12 12:59:28 -08:00
										 |  |  | export interface ContextMenuPresets { | 
					
						
							|  |  |  |   delete: ContextMenuItem; | 
					
						
							|  |  |  |   edit: ContextMenuItem; | 
					
						
							|  |  |  |   save: ContextMenuItem; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export function useContextPresets(): ContextMenuPresets { | 
					
						
							| 
									
										
										
										
											2022-06-03 20:12:32 -08:00
										 |  |  |   const { $globals, i18n } = useContext(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return { | 
					
						
							|  |  |  |     delete: { | 
					
						
							|  |  |  |       title: i18n.tc("general.delete"), | 
					
						
							|  |  |  |       icon: $globals.icons.delete, | 
					
						
							|  |  |  |       event: "delete", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     edit: { | 
					
						
							|  |  |  |       title: i18n.tc("general.edit"), | 
					
						
							|  |  |  |       icon: $globals.icons.edit, | 
					
						
							|  |  |  |       event: "edit", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     save: { | 
					
						
							|  |  |  |       title: i18n.tc("general.save"), | 
					
						
							|  |  |  |       icon: $globals.icons.save, | 
					
						
							|  |  |  |       event: "save", | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | } |