0.4.0 convex及界面修改

This commit is contained in:
liaibo
2026-02-01 08:47:40 +08:00
parent d1f055f51a
commit af92c4b149
636 changed files with 7522 additions and 1815 deletions
+34
View File
@@ -0,0 +1,34 @@
"use client";
import { create } from "zustand";
export type CommentTarget = {
workspaceId: string;
documentId: string;
blockId: string | null;
};
interface CommentsUiState {
open: boolean;
target: CommentTarget | null;
openForPage: (args: { workspaceId: string; documentId: string }) => void;
openForBlock: (args: { workspaceId: string; documentId: string; blockId: string }) => void;
close: () => void;
}
export const useCommentsUiStore = create<CommentsUiState>((set) => ({
open: false,
target: null,
openForPage: ({ workspaceId, documentId }) =>
set({
open: true,
target: { workspaceId, documentId, blockId: null },
}),
openForBlock: ({ workspaceId, documentId, blockId }) =>
set({
open: true,
target: { workspaceId, documentId, blockId },
}),
close: () => set({ open: false }),
}));