'use client'; import { useState, useEffect, useRef } from 'react'; import { SplitSide, type DiffFile } from '@git-diff-view/react'; import { Button } from '@kandev/ui/button'; import { Badge } from '@kandev/ui/badge'; import { Textarea } from '@kandev/ui/textarea'; import { findRowByLineNumber } from './dom-utils'; import type { DragSelectionState } from './types'; interface MultiLineCommentInputProps { startLine: number; endLine: number; side: SplitSide; onSave: (content: string) => void; onCancel: () => void; } export function MultiLineCommentInput({ startLine, endLine, side, onSave, onCancel, }: MultiLineCommentInputProps) { const [content, setContent] = useState(''); const textareaRef = useRef(null); useEffect(() => { textareaRef.current?.focus(); }, []); return (
Comment on lines {startLine} to {endLine} {side === SplitSide.old ? 'old' : 'new'}