"use client"; import { useState } from "react"; import { CommentComposer } from "@/components/chat-comments/comment-composer/comment-composer"; import { CommentItem } from "@/components/chat-comments/comment-item/comment-item"; import type { CommentData } from "@/components/chat-comments/comment-item/types"; import { MemberMentionPicker } from "@/components/chat-comments/member-mention-picker/member-mention-picker"; import type { MemberOption } from "@/components/chat-comments/member-mention-picker/types"; const fakeMembersData: MemberOption[] = [ { id: "550e8400-e29b-41d4-a716-446655440001", displayName: "Alice Smith", email: "alice@example.com", avatarUrl: null, }, { id: "550e8400-e29b-41d4-a716-446655440002", displayName: "Bob Johnson", email: "bob.johnson@example.com", avatarUrl: null, }, { id: "550e8400-e29b-41d4-a716-446655440003", displayName: "Charlie Brown", email: "charlie@example.com", avatarUrl: null, }, { id: "550e8400-e29b-41d4-a716-446655440004", displayName: null, email: "david.wilson@example.com", avatarUrl: null, }, { id: "550e8400-e29b-41d4-a716-446655440005", displayName: "Emma Davis", email: "emma@example.com", avatarUrl: null, }, ]; const fakeCommentsData: CommentData[] = [ { id: 1, content: "This is a great response! @Alice Smith can you review?", contentRendered: "This is a great response! @Alice Smith can you review?", author: { id: "550e8400-e29b-41d4-a716-446655440002", displayName: "Bob Johnson", email: "bob.johnson@example.com", avatarUrl: null, }, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), isEdited: false, canEdit: true, canDelete: true, }, { id: 2, content: "I checked this yesterday and it looks good.", contentRendered: "I checked this yesterday and it looks good.", author: { id: "550e8400-e29b-41d4-a716-446655440001", displayName: "Alice Smith", email: "alice@example.com", avatarUrl: null, }, createdAt: new Date(Date.now() - 86400000).toISOString(), updatedAt: new Date(Date.now() - 3600000).toISOString(), isEdited: true, canEdit: false, canDelete: true, }, { id: 3, content: "Thanks @Bob Johnson and @Alice Smith for the quick turnaround!", contentRendered: "Thanks @Bob Johnson and @Alice Smith for the quick turnaround!", author: { id: "550e8400-e29b-41d4-a716-446655440004", displayName: null, email: "david.wilson@example.com", avatarUrl: null, }, createdAt: new Date(Date.now() - 3600000 * 3).toISOString(), updatedAt: new Date(Date.now() - 3600000 * 3).toISOString(), isEdited: false, canEdit: true, canDelete: false, }, ]; export default function ChatCommentsPreviewPage() { const [highlightedIndex, setHighlightedIndex] = useState(0); const [selectedMember, setSelectedMember] = useState(null); const [submittedContent, setSubmittedContent] = useState(null); return (

Chat Comments UI Preview

Preview page for chat comments components with fake data

{/* Comment Composer Section */}

Comment Composer

Type @ to trigger mention picker. Use Tab/Shift+Tab/Arrow keys to navigate, Enter to select.

setSubmittedContent(content)} onCancel={() => setSubmittedContent(null)} autoFocus />
{submittedContent && (
Submitted content: {submittedContent}
)}
{/* Comment Item Section */}

Comment Item

Hover over comments to see the action menu. Mentions are highlighted.

{/* Comment with replies */}
alert(`Edit comment ${id}`)} onDelete={(id) => alert(`Delete comment ${id}`)} onReply={(id) => alert(`Reply to comment ${id}`)} /> alert(`Edit reply ${id}`)} onDelete={(id) => alert(`Delete reply ${id}`)} />
{/* Standalone comment */} alert(`Edit comment ${id}`)} onDelete={(id) => alert(`Delete comment ${id}`)} onReply={(id) => alert(`Reply to comment ${id}`)} />
{/* Member Mention Picker Section */}

Member Mention Picker (Standalone)

After typing @

Shows all members

setSelectedMember(member)} onHighlightChange={setHighlightedIndex} />
{selectedMember && (
Selected: @[{selectedMember.id.slice(0, 8)}...]
)}

After typing @ali

Filtered to matching members

{}} onHighlightChange={() => {}} />

Loading State

While fetching members

{}} onHighlightChange={() => {}} />

No Results

After typing @xyz (no match)

{}} onHighlightChange={() => {}} />
); }