mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
Timeline Item
This commit is contained in:
parent
d75a3419c3
commit
bb46dd1317
1 changed files with 65 additions and 82 deletions
|
@ -91,7 +91,7 @@
|
||||||
</v-timeline-item>
|
</v-timeline-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import RecipeCardMobile from "./RecipeCardMobile.vue";
|
import RecipeCardMobile from "./RecipeCardMobile.vue";
|
||||||
import RecipeTimelineContextMenu from "./RecipeTimelineContextMenu.vue";
|
import RecipeTimelineContextMenu from "./RecipeTimelineContextMenu.vue";
|
||||||
import { useStaticRoutes } from "~/composables/api";
|
import { useStaticRoutes } from "~/composables/api";
|
||||||
|
@ -100,30 +100,26 @@ import type { Recipe, RecipeTimelineEventOut } from "~/lib/api/types/recipe";
|
||||||
import UserAvatar from "~/components/Domain/User/UserAvatar.vue";
|
import UserAvatar from "~/components/Domain/User/UserAvatar.vue";
|
||||||
import SafeMarkdown from "~/components/global/SafeMarkdown.vue";
|
import SafeMarkdown from "~/components/global/SafeMarkdown.vue";
|
||||||
|
|
||||||
export default defineNuxtComponent({
|
interface Props {
|
||||||
components: { RecipeCardMobile, RecipeTimelineContextMenu, UserAvatar, SafeMarkdown },
|
event: RecipeTimelineEventOut;
|
||||||
|
recipe?: Recipe;
|
||||||
|
showRecipeCards?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
props: {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
event: {
|
recipe: undefined,
|
||||||
type: Object as () => RecipeTimelineEventOut,
|
showRecipeCards: false,
|
||||||
required: true,
|
});
|
||||||
},
|
|
||||||
recipe: {
|
defineEmits<{
|
||||||
type: Object as () => Recipe,
|
selected: [];
|
||||||
default: undefined,
|
update: [];
|
||||||
},
|
delete: [];
|
||||||
showRecipeCards: {
|
}>();
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
emits: ["selected", "update", "delete"],
|
|
||||||
|
|
||||||
setup(props) {
|
|
||||||
const { $vuetify, $globals } = useNuxtApp();
|
const { $vuetify, $globals } = useNuxtApp();
|
||||||
const { recipeTimelineEventImage } = useStaticRoutes();
|
const { recipeTimelineEventImage } = useStaticRoutes();
|
||||||
const { eventTypeOptions } = useTimelineEventTypes();
|
const { eventTypeOptions } = useTimelineEventTypes();
|
||||||
const timelineEvents = ref([] as RecipeTimelineEventOut[]);
|
|
||||||
|
|
||||||
const { user: currentUser } = useMealieAuth();
|
const { user: currentUser } = useMealieAuth();
|
||||||
|
|
||||||
|
@ -178,19 +174,6 @@ export default defineNuxtComponent({
|
||||||
|
|
||||||
return recipeTimelineEventImage(props.event.recipeId, props.event.id);
|
return recipeTimelineEventImage(props.event.recipeId, props.event.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
attrs,
|
|
||||||
groupSlug,
|
|
||||||
icon,
|
|
||||||
eventImageUrl,
|
|
||||||
hideImage,
|
|
||||||
timelineEvents,
|
|
||||||
useMobileFormat,
|
|
||||||
currentUser,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue