| 
									
										
										
										
											2022-12-11 15:16:55 -06:00
										 |  |  |  | <template> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |  |   <v-tooltip | 
					
						
							|  |  |  |  |     bottom | 
					
						
							|  |  |  |  |     nudge-right="50" | 
					
						
							|  |  |  |  |     :color="buttonStyle ? 'info' : 'secondary'" | 
					
						
							|  |  |  |  |   > | 
					
						
							|  |  |  |  |     <template #activator="{ props }"> | 
					
						
							| 
									
										
										
										
											2022-12-11 15:16:55 -06:00
										 |  |  |  |       <v-btn | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |  |         icon | 
					
						
							|  |  |  |  |         :variant="buttonStyle ? 'flat' : undefined" | 
					
						
							|  |  |  |  |         :rounded="buttonStyle ? 'circle' : undefined" | 
					
						
							|  |  |  |  |         size="small" | 
					
						
							| 
									
										
										
										
											2022-12-11 15:16:55 -06:00
										 |  |  |  |         :color="buttonStyle ? 'info' : 'secondary'" | 
					
						
							|  |  |  |  |         :fab="buttonStyle" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |  |         v-bind="{ ...props, ...$attrs }" | 
					
						
							| 
									
										
										
										
											2022-12-11 15:16:55 -06:00
										 |  |  |  |         @click.prevent="toggleTimeline" | 
					
						
							|  |  |  |  |       > | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |  |         <v-icon | 
					
						
							|  |  |  |  |           :size="!buttonStyle ? undefined : 'x-large'" | 
					
						
							|  |  |  |  |           :color="buttonStyle ? 'white' : 'secondary'" | 
					
						
							|  |  |  |  |         > | 
					
						
							| 
									
										
										
										
											2022-12-11 15:16:55 -06:00
										 |  |  |  |           {{ $globals.icons.timelineText }} | 
					
						
							|  |  |  |  |         </v-icon> | 
					
						
							|  |  |  |  |       </v-btn> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |  |       <BaseDialog | 
					
						
							|  |  |  |  |         v-model="showTimeline" | 
					
						
							|  |  |  |  |         :title="timelineAttrs.title" | 
					
						
							|  |  |  |  |         :icon="$globals.icons.timelineText" | 
					
						
							|  |  |  |  |         width="70%" | 
					
						
							|  |  |  |  |       > | 
					
						
							|  |  |  |  |         <RecipeTimeline | 
					
						
							|  |  |  |  |           v-model="showTimeline" | 
					
						
							|  |  |  |  |           :query-filter="timelineAttrs.queryFilter" | 
					
						
							|  |  |  |  |           max-height="60vh" | 
					
						
							|  |  |  |  |         /> | 
					
						
							| 
									
										
										
										
											2023-04-25 12:46:00 -05:00
										 |  |  |  |       </BaseDialog> | 
					
						
							| 
									
										
										
										
											2022-12-11 15:16:55 -06:00
										 |  |  |  |     </template> | 
					
						
							|  |  |  |  |     <span>{{ $t('recipe.open-timeline') }}</span> | 
					
						
							|  |  |  |  |   </v-tooltip> | 
					
						
							|  |  |  |  | </template> | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | <script lang="ts"> | 
					
						
							| 
									
										
										
										
											2023-04-25 12:46:00 -05:00
										 |  |  |  | import RecipeTimeline from "./RecipeTimeline.vue"; | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | export default defineNuxtComponent({ | 
					
						
							| 
									
										
										
										
											2023-04-25 12:46:00 -05:00
										 |  |  |  |   components: { RecipeTimeline }, | 
					
						
							| 
									
										
										
										
											2022-12-11 15:16:55 -06:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |   props: { | 
					
						
							|  |  |  |  |     buttonStyle: { | 
					
						
							|  |  |  |  |       type: Boolean, | 
					
						
							|  |  |  |  |       default: false, | 
					
						
							|  |  |  |  |     }, | 
					
						
							|  |  |  |  |     slug: { | 
					
						
							|  |  |  |  |       type: String, | 
					
						
							|  |  |  |  |       default: "", | 
					
						
							|  |  |  |  |     }, | 
					
						
							|  |  |  |  |     recipeName: { | 
					
						
							|  |  |  |  |       type: String, | 
					
						
							|  |  |  |  |       default: "", | 
					
						
							|  |  |  |  |     }, | 
					
						
							|  |  |  |  |   }, | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-25 12:46:00 -05:00
										 |  |  |  |   setup(props) { | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |  |     const i18n = useI18n(); | 
					
						
							|  |  |  |  |     const { smAndDown } = useDisplay(); | 
					
						
							| 
									
										
										
										
											2022-12-11 15:16:55 -06:00
										 |  |  |  |     const showTimeline = ref(false); | 
					
						
							|  |  |  |  |     function toggleTimeline() { | 
					
						
							|  |  |  |  |       showTimeline.value = !showTimeline.value; | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-25 12:46:00 -05:00
										 |  |  |  |     const timelineAttrs = computed(() => { | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |  |       let title = i18n.t("recipe.timeline"); | 
					
						
							|  |  |  |  |       if (smAndDown.value) { | 
					
						
							|  |  |  |  |         title += ` – ${props.recipeName}`; | 
					
						
							| 
									
										
										
										
											2023-04-25 12:46:00 -05:00
										 |  |  |  |       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |       return { | 
					
						
							|  |  |  |  |         title, | 
					
						
							|  |  |  |  |         queryFilter: `recipe.slug="${props.slug}"`, | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |  |       }; | 
					
						
							|  |  |  |  |     }); | 
					
						
							| 
									
										
										
										
											2023-04-25 12:46:00 -05:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |     return { showTimeline, timelineAttrs, toggleTimeline }; | 
					
						
							| 
									
										
										
										
											2022-12-11 15:16:55 -06:00
										 |  |  |  |   }, | 
					
						
							|  |  |  |  | }); | 
					
						
							|  |  |  |  | </script> |