import type { LysandClient } from "@lysand-org/client"; import type { Context } from "@lysand-org/client/types"; export const useNoteContext = ( client: MaybeRef, noteId: MaybeRef, ) => { if (!ref(client).value) { return ref(null as Context | null); } const output = ref(null as Context | null); watchEffect(() => { if (toValue(noteId)) ref(client) .value?.getStatusContext(toValue(noteId) ?? "") .then((res) => { output.value = res.data; }); }); return output; };