frontend/app/components/timelines/global.vue

43 lines
830 B
Vue
Raw Normal View History

<template>
2025-12-09 22:32:22 +01:00
<Timeline
type="status"
:items="items"
:is-loading="isLoading"
:has-reached-end="hasReachedEnd"
:error="error"
:load-next="loadNext"
:load-prev="loadPrev"
:remove-item="removeItem"
:update-item="updateItem"
/>
</template>
<script lang="ts" setup>
import type { z } from "zod";
import { useGlobalTimeline } from "~/composables/GlobalTimeline";
import Timeline from "./timeline.vue";
const {
error,
hasReachedEnd,
isLoading,
items,
loadNext,
loadPrev,
removeItem,
updateItem,
} = useGlobalTimeline();
useListen("note:delete", ({ id }) => {
removeItem(id);
});
useListen("note:edit", (updatedNote) => {
updateItem(updatedNote);
});
useListen("composer:send", () => {
loadPrev();
});
</script>