feat: init public notes

This commit is contained in:
Julien Calixte
2026-02-10 20:05:21 +01:00
parent eb88bfa8e4
commit 63903d48eb
4 changed files with 62 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
<script setup lang="ts">
import { PublicNoteListItem } from "@/modules/note/models/Note"
import { useAsyncState } from "@vueuse/core"
const { state, isLoading } = useAsyncState<{
notes: PublicNoteListItem[]
}>(
async () => {
const response = await fetch("https://api.litenote.li212.fr/notes")
return response.json()
},
{ notes: [] },
)
</script>
<template>
<div v-if="isLoading"></div>
<div class="public-note-view" v-else>
<ul>
<li v-for="note in state.notes">
{{ note.did }}/{{ note.rkey }}: {{ note.title }}
</li>
</ul>
</div>
</template>
<style scoped lang="scss">
.public-note-view {
}
</style>