11import Badge from '@app/components/Common/Badge' ;
22import Button from '@app/components/Common/Button' ;
33import CachedImage from '@app/components/Common/CachedImage' ;
4+ import Tooltip from '@app/components/Common/Tooltip' ;
45import { issueOptions } from '@app/components/IssueModal/constants' ;
56import { Permission , useUser } from '@app/hooks/useUser' ;
67import globalMessages from '@app/i18n/globalMessages' ;
@@ -26,6 +27,7 @@ const messages = defineMessages('components.IssueList.IssueItem', {
2627 opened : 'Opened' ,
2728 viewissue : 'View Issue' ,
2829 unknownissuetype : 'Unknown' ,
30+ descriptionpreview : 'Issue Description' ,
2931} ) ;
3032
3133const isMovie = ( movie : MovieDetails | TvDetails ) : movie is MovieDetails => {
@@ -107,8 +109,15 @@ const IssueItem = ({ issue }: IssueItemProps) => {
107109 }
108110 }
109111
112+ const description = issue . comments ?. [ 0 ] ?. message || '' ;
113+ const maxDescriptionLength = 120 ;
114+ const shouldTruncate = description . length > maxDescriptionLength ;
115+ const truncatedDescription = shouldTruncate
116+ ? description . substring ( 0 , maxDescriptionLength ) + '...'
117+ : description ;
118+
110119 return (
111- < div className = "relative flex w-full flex-col justify-between overflow-hidden rounded-xl bg-gray-800 py-4 text-gray-400 shadow-md ring-1 ring-gray-700 xl:h-28 xl: flex-row" >
120+ < div className = "relative flex w-full flex-col justify-between overflow-hidden rounded-xl bg-gray-800 py-4 text-gray-400 shadow-md ring-1 ring-gray-700 xl:flex-row" >
112121 { title . backdropPath && (
113122 < div className = "absolute inset-0 z-0 w-full bg-cover bg-center xl:w-2/3" >
114123 < CachedImage
@@ -168,8 +177,38 @@ const IssueItem = ({ issue }: IssueItemProps) => {
168177 >
169178 { isMovie ( title ) ? title . title : title . name }
170179 </ Link >
180+ { description && (
181+ < div className = "mt-1 max-w-full" >
182+ < div className = "overflow-hidden text-sm text-gray-300" >
183+ { shouldTruncate ? (
184+ < Tooltip
185+ content = {
186+ < div className = "max-w-sm p-3" >
187+ < div className = "mb-1 text-sm font-medium text-gray-200" >
188+ Issue Description
189+ </ div >
190+ < div className = "whitespace-pre-wrap text-sm leading-relaxed text-gray-300" >
191+ { description }
192+ </ div >
193+ </ div >
194+ }
195+ tooltipConfig = { {
196+ placement : 'top' ,
197+ offset : [ 0 , 8 ] ,
198+ } }
199+ >
200+ < span className = "block cursor-help truncate transition-colors hover:text-gray-200" >
201+ { truncatedDescription }
202+ </ span >
203+ </ Tooltip >
204+ ) : (
205+ < span className = "block break-words" > { description } </ span >
206+ ) }
207+ </ div >
208+ </ div >
209+ ) }
171210 { problemSeasonEpisodeLine . length > 0 && (
172- < div className = "card-field" >
211+ < div className = "card-field mt-1 " >
173212 { problemSeasonEpisodeLine . map ( ( t , k ) => (
174213 < span key = { k } > { t } </ span >
175214 ) ) }
0 commit comments