fix: dashboard edit previews, migration journal, and notes comments
Register drizzle journal entries for 0022/0023 so prod migrations apply. Key edit-mode widget previews by index so bangs.stats shows live data. Add comments to notes detail pages.
This commit is contained in:
@@ -4,6 +4,7 @@ import dynamic from "next/dynamic";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Pin, PinOff, Save, Trash2 } from "lucide-react";
|
||||
import { useState, useTransition } from "react";
|
||||
import { EntityComments } from "@/components/comments/entity-comments";
|
||||
import { RichTextContent } from "@/components/rich-text";
|
||||
import { DetailBackLink } from "@/components/detail-back-link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -25,7 +26,7 @@ const RichTextEditor = dynamic(
|
||||
},
|
||||
);
|
||||
|
||||
export function NoteEditor({ note }: { note?: NoteDto }) {
|
||||
export function NoteEditor({ note, currentUserId }: { note?: NoteDto; currentUserId?: string }) {
|
||||
const router = useRouter();
|
||||
const [currentNote, setCurrentNote] = useState(note);
|
||||
const [title, setTitle] = useState(note?.title ?? "");
|
||||
@@ -147,6 +148,14 @@ export function NoteEditor({ note }: { note?: NoteDto }) {
|
||||
<RichTextContent html={body} />
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
{currentNote && currentUserId ? (
|
||||
<EntityComments
|
||||
entityType="notes.note"
|
||||
entityId={currentNote.id}
|
||||
currentUserId={currentUserId}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user