@@ -16,6 +16,7 @@ import {
16
16
import {
17
17
SearchableSelectSeriesQuery ,
18
18
} from "./__generated__/SearchableSelectSeriesQuery.graphql" ;
19
+ import { LuCalendar } from "react-icons/lu" ;
19
20
20
21
21
22
type DerivedProps < T > = Omit < Parameters < typeof AsyncSelect < T > > [ 0 ] ,
@@ -132,6 +133,7 @@ export type VideoListOption = {
132
133
readonly opencastId : string ;
133
134
readonly title : string ;
134
135
readonly description ?: string | null ;
136
+ readonly created ?: string | null ;
135
137
} ;
136
138
137
139
export const VideoListSelector : React . FC < VideoListSelectorProps > = ( {
@@ -149,6 +151,7 @@ export const VideoListSelector: React.FC<VideoListSelectorProps> = ({
149
151
opencastId
150
152
title
151
153
description
154
+ created
152
155
}
153
156
}
154
157
}
@@ -206,7 +209,28 @@ export const VideoListSelector: React.FC<VideoListSelectorProps> = ({
206
209
207
210
const formatVideoListOption = ( videoList : VideoListOption , _ : TFunction ) => (
208
211
< div >
209
- < div > { videoList . title } </ div >
212
+ < div css = { { display : "flex" , gap : 8 } } >
213
+ { videoList . title }
214
+ { videoList . created && < DateWithIcon dateString = { videoList . created } /> }
215
+ </ div >
210
216
< SmallDescription css = { { margin : 0 } } lines = { 1 } text = { videoList . description } />
211
217
</ div >
212
218
) ;
219
+
220
+ const DateWithIcon : React . FC < { dateString : string } > = ( { dateString } ) => {
221
+ const { i18n } = useTranslation ( ) ;
222
+ const date = new Date ( dateString ) ;
223
+
224
+ return < div css = { {
225
+ display : "flex" ,
226
+ gap : 4 ,
227
+ fontSize : 10 ,
228
+ color : COLORS . neutral60 ,
229
+ alignItems : "center" ,
230
+ } } >
231
+ < LuCalendar />
232
+ < time dateTime = { date . toISOString ( ) } >
233
+ { date . toLocaleDateString ( i18n . language ) }
234
+ </ time >
235
+ </ div > ;
236
+ } ;
0 commit comments