feat: Add Enum preference type support

This commit is contained in:
Jesse Wierzbinski 2024-12-04 14:34:09 +01:00
parent ca824a2a1a
commit dca7af4b0e
No known key found for this signature in database
10 changed files with 149 additions and 4 deletions

View file

@ -0,0 +1,34 @@
<template>
<Timeline type="status" :items="(items as Status[])" :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 { Status } from "@versia/client/types";
import { useGlobalTimeline } from "~/composables/GlobalTimeline";
import Timeline from "./timeline.vue";
const {
error,
hasReachedEnd,
isLoading,
items,
loadNext,
loadPrev,
removeItem,
updateItem,
} = useGlobalTimeline(client.value);
useListen("note:delete", ({ id }) => {
removeItem(id);
});
useListen("note:edit", (updatedNote) => {
updateItem(updatedNote);
});
useListen("composer:send", () => {
loadPrev();
});
</script>

View file

@ -2,7 +2,7 @@
<template>
<div class="timeline rounded">
<TransitionGroup name="timeline-item" tag="div"
class="timeline-items *:rounded space-y-4 *:border *:border-border/50">
class="timeline-items *:rounded space-y-4 *:border">
<TimelineItem :type="type" v-for="item in items" :key="item.id" :item="item" @update="updateItem"
@delete="removeItem" />
</TransitionGroup>