@@ -388,50 +388,71 @@ export default function TIXDetailsModal({
388388 { artefact . artefact_name }
389389 </ code >
390390 </ div >
391-
391+
392392 { /* Sources */ }
393- { artefact . sources && artefact . sources . length > 0 && (
394- < div className = "mb-2" >
395- < p className = "text-xs font-medium text-muted-foreground mb-1" >
396- { translations . tixDetailsModal ?. sources || 'Sources' } :
397- </ p >
398- < div className = "flex flex-wrap gap-1" >
399- { artefact . sources . map ( ( source : string , sourceIndex : number ) => (
400- < Badge
401- key = { sourceIndex }
402- variant = "outline"
403- className = "text-xs"
404- >
405- { source }
406- </ Badge >
407- ) ) }
393+ { artefact . sources &&
394+ artefact . sources . length > 0 && (
395+ < div className = "mb-2" >
396+ < p className = "text-xs font-medium text-muted-foreground mb-1" >
397+ { translations . tixDetailsModal
398+ ?. sources || 'Sources' }
399+ :
400+ </ p >
401+ < div className = "flex flex-wrap gap-1" >
402+ { artefact . sources . map (
403+ (
404+ source : string ,
405+ sourceIndex : number
406+ ) => (
407+ < Badge
408+ key = { sourceIndex }
409+ variant = "outline"
410+ className = "text-xs"
411+ >
412+ { source }
413+ </ Badge >
414+ )
415+ ) }
416+ </ div >
408417 </ div >
409- </ div >
410- ) }
411-
418+ ) }
419+
412420 { artefact . used_in_lines && (
413421 < div className = "text-muted-foreground text-xs" >
414- { translations . tixDetailsModal ?. lines || 'Lines' } :{ ' ' }
415- { typeof artefact . used_in_lines === 'string'
416- ? artefact . used_in_lines . split ( ',' ) . map ( ( line : string , lineIndex : number ) => (
417- < span
418- key = { lineIndex }
419- className = "inline-block bg-orange-100 text-orange-800 px-1 rounded mr-1 text-xs"
420- >
421- { line . trim ( ) }
422- </ span >
423- ) )
424- : Array . isArray ( artefact . used_in_lines )
425- ? artefact . used_in_lines . map ( ( line : number ) => (
426- < span
427- key = { line }
428- className = "inline-block bg-orange-100 text-orange-800 px-1 rounded mr-1 text-xs"
429- >
430- { line }
431- </ span >
432- ) )
433- : null
434- }
422+ { translations . tixDetailsModal
423+ ?. lines || 'Lines' }
424+ :{ ' ' }
425+ { typeof artefact . used_in_lines ===
426+ 'string'
427+ ? artefact . used_in_lines
428+ . split ( ',' )
429+ . map (
430+ (
431+ line : string ,
432+ lineIndex : number
433+ ) => (
434+ < span
435+ key = { lineIndex }
436+ className = "inline-block bg-orange-100 text-orange-800 px-1 rounded mr-1 text-xs"
437+ >
438+ { line . trim ( ) }
439+ </ span >
440+ )
441+ )
442+ : Array . isArray (
443+ artefact . used_in_lines
444+ )
445+ ? artefact . used_in_lines . map (
446+ ( line : number ) => (
447+ < span
448+ key = { line }
449+ className = "inline-block bg-orange-100 text-orange-800 px-1 rounded mr-1 text-xs"
450+ >
451+ { line }
452+ </ span >
453+ )
454+ )
455+ : null }
435456 </ div >
436457 ) }
437458 </ div >
0 commit comments