import type { Status } from "@versia/client/schemas"; import type { z } from "zod"; export const useNote = (noteId: MaybeRef) => { if (!toValue(noteId)) { return ref(null as z.infer | null); } const authStore = useAuthStore(); const output = ref(null as z.infer | null); watchEffect(() => { toValue(noteId) && authStore.client .getStatus(toValue(noteId) as string) .then((res) => { output.value = res.data; }); }); return output; };