Loading component…
Loading component…
Comment feed with filters, runnable /edit commands, resolve and a composer
To reuse this local React demo, copy all files from the Code tab into the same folder, then import CommentsPanel from ./comments-panel.
import { CommentsPanel } from "@/components/ui/comments-panel";
export function Sidebar({ comments, me }) {
return (
<CommentsPanel
comments={comments}
currentUser={me}
onRunEdit={(c) => api.applyEdit(c.text)}
onAdd={(c) => api.saveComment(c)}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| comments | PanelComment[] | id, author ({ name, avatar }), createdAt and text – text starting with /edit becomes a runnable edit | |
| currentUser | CommentAuthor | Author of new comments | |
| onRunEdit | (comment) => Promise<void> \| void | Runs an edit; the button shows Running… until the promise settles | |
| onAdd | (comment) => void | Called with every new comment | |
| onClose | () => void | Shows a close button | |
| title | string | "Comments" | Heading in the gray tray |
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"