import type { CommentAuthor, CommentSide } from './types'; import { CommentForm } from './comment-form'; interface CommentFormRowProps { colSpan: number; filePath: string; side: CommentSide; startLine: number; endLine: number; currentAuthor: CommentAuthor; onSubmit: (filePath: string, side: CommentSide, startLine: number, endLine: number, body: string, author: CommentAuthor) => void; onCancel: () => void; viewMode?: 'unified' | 'split'; } export function CommentFormRow(props: CommentFormRowProps) { const { colSpan, filePath, side, startLine, endLine, currentAuthor, onSubmit, onCancel, viewMode } = props; const lineLabel = startLine === endLine ? `${startLine}` : `${startLine} to ${endLine}`; const formContent = (
onSubmit(filePath, side, startLine, endLine, body, currentAuthor)} onCancel={onCancel} lineLabel={`Add a comment on line${startLine !== endLine ? 's' : ''} ${lineLabel}`} />
); if (viewMode === 'split') { return ( {side === 'old' ? ( <> {formContent} ) : ( <> {formContent} )} ); } return ( {formContent} ); }