import React, { useState } from 'react'; import { RiMoreLine, RiDeleteBinLine, RiEditLine, RiArrowDownSLine, RiArrowUpSLine } from '@remixicon/react'; import type { InlineCommentDraft } from '@/stores/useInlineCommentDraftStore'; import { useOptionalThemeSystem } from '@/contexts/useThemeSystem'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'; interface InlineCommentCardProps { draft: InlineCommentDraft; onEdit: () => void; onDelete: () => void; className?: string; maxWidth?: number; } export function InlineCommentCard({ draft, onEdit, onDelete, className, maxWidth, }: InlineCommentCardProps) { const themeContext = useOptionalThemeSystem(); const currentTheme = themeContext?.currentTheme; const [isOpen, setIsOpen] = useState(false); // Check if content is long enough to warrant collapsing (rough estimate) // In a real app we might measure line height, but length check is a good proxy for now const isLongContent = draft.text.length > 150 || draft.text.split('\n').length > 3; return (
{draft.fileLabel} Lines {draft.startLine}-{draft.endLine} {draft.side && ({draft.side})}
{draft.text}
{isLongContent && ( )} {/* Used for animation purposes if we want to animate height */}
Edit comment Delete comment
); }