@@ -27,28 +27,28 @@ export function ComposerPendingReviewComments({
2727 < div className = { cn ( "flex flex-wrap gap-1.5" , className ) } >
2828 { comments . map ( ( comment ) => {
2929 const label = `${ comment . filePath } ${ comment . rangeLabel } ` ;
30+ const chip = (
31+ < span key = { comment . id } className = { cn ( COMPOSER_INLINE_CHIP_CLASS_NAME , "pr-1" ) } >
32+ < MessageCircle className = { cn ( COMPOSER_INLINE_CHIP_ICON_CLASS_NAME , "size-3.5" ) } />
33+ < span className = { COMPOSER_INLINE_CHIP_LABEL_CLASS_NAME } > { label } </ span >
34+ < button
35+ type = "button"
36+ aria-label = { `Remove comment on ${ label } ` }
37+ className = { COMPOSER_INLINE_CHIP_DISMISS_BUTTON_CLASS_NAME }
38+ onClick = { ( event ) => {
39+ event . preventDefault ( ) ;
40+ event . stopPropagation ( ) ;
41+ onRemove ( comment . id ) ;
42+ } }
43+ >
44+ < X className = "size-3" aria-hidden />
45+ </ button >
46+ </ span >
47+ ) ;
48+ if ( comment . text . length === 0 ) return chip ;
3049 return (
3150 < Tooltip key = { comment . id } >
32- < TooltipTrigger
33- render = {
34- < span className = { cn ( COMPOSER_INLINE_CHIP_CLASS_NAME , "pr-1" ) } >
35- < MessageCircle className = { cn ( COMPOSER_INLINE_CHIP_ICON_CLASS_NAME , "size-3.5" ) } />
36- < span className = { COMPOSER_INLINE_CHIP_LABEL_CLASS_NAME } > { label } </ span >
37- < button
38- type = "button"
39- aria-label = { `Remove comment on ${ label } ` }
40- className = { COMPOSER_INLINE_CHIP_DISMISS_BUTTON_CLASS_NAME }
41- onClick = { ( event ) => {
42- event . preventDefault ( ) ;
43- event . stopPropagation ( ) ;
44- onRemove ( comment . id ) ;
45- } }
46- >
47- < X className = "size-3" aria-hidden />
48- </ button >
49- </ span >
50- }
51- />
51+ < TooltipTrigger render = { chip } />
5252 < TooltipPopup side = "top" className = "max-w-96 whitespace-pre-wrap leading-tight" >
5353 { comment . text }
5454 </ TooltipPopup >
0 commit comments