33import { format , parseISO , compareAsc } from "date-fns"
44import { ReactElement , useEffect , useState } from "react"
55
6- import { getEventTitle } from "@/app/conf/2023/utils"
7- import { SchedSpeaker } from "@/app/conf/2023/types"
8-
96import { Filters , ResetFiltersButton } from "./filters"
107import {
118 type ScheduleSession ,
129 CategoryName ,
1310 ConcurrentSessions ,
1411 ScheduleSessionsByDay ,
1512} from "./session-list"
16- import { PinIcon } from "../../pixelarticons/pin-icon"
17- import { Tag } from "@/app/conf/_design-system/tag"
18-
19- function isString ( x : any ) {
20- return Object . prototype . toString . call ( x ) === "[object String]"
21- }
13+ import { ScheduleSessionCard } from "./schedule-session-card"
2214
2315function getSessionsByDay (
2416 scheduleData : ScheduleSession [ ] ,
@@ -187,7 +179,7 @@ export function ScheduleList({
187179 </ div >
188180 < div className = "relative flex w-full flex-col items-end lg:flex-row lg:items-start lg:gap-px" >
189181 { sessions . map ( session => (
190- < ScheduleSession
182+ < ScheduleSessionCard
191183 key = { session . id }
192184 session = { session }
193185 showEventType = { showEventType }
@@ -209,74 +201,6 @@ export function ScheduleList({
209201 )
210202}
211203
212- function ScheduleSession ( {
213- session,
214- showEventType,
215- year,
216- eventsColors,
217- } : {
218- session : ScheduleSession
219- showEventType : boolean | undefined
220- year : "2025" | "2024"
221- eventsColors : Record < string , string >
222- } ) {
223- const eventType = session . event_type . endsWith ( "s" )
224- ? session . event_type . slice ( 0 , - 1 )
225- : session . event_type
226-
227- const speakers = session . speakers
228- const formattedSpeakers = isString ( speakers || [ ] )
229- ? ( speakers as string ) ?. split ( "," )
230- : ( speakers as SchedSpeaker [ ] ) ?. map ( e => e . name )
231-
232- const eventTitle = getEventTitle (
233- // @ts -expect-error fixme
234- session ,
235- formattedSpeakers ,
236- )
237-
238- const eventColor = eventsColors [ session . event_type ]
239-
240- return session . event_type === "Breaks" ? (
241- < div className = "flex size-full items-center bg-neu-0 px-4 py-2 font-normal" >
242- { showEventType ? eventType + " / " : "" }
243- { eventTitle }
244- </ div >
245- ) : (
246- < a
247- id = { `session-${ session . id } ` }
248- data-tooltip-id = "my-tooltip"
249- href = { `/conf/${ year } /schedule/${ session . id } ?name=${ session . name } ` }
250- className = "group relative size-full bg-neu-0 p-4 font-normal no-underline focus-visible:z-[1] max-lg:mt-px"
251- >
252- < span className = "flex h-full flex-col justify-start" >
253- { eventColor && (
254- < Tag className = "mb-3" color = { eventColor } >
255- { eventType }
256- </ Tag >
257- ) }
258- < span className = "flex h-full flex-col justify-between gap-y-2" >
259- { showEventType ? eventType + " / " : "" }
260- < span className = "typography-body-md group-hover:underline" >
261- { eventTitle }
262- </ span >
263- < span className = "flex flex-col" >
264- { ( speakers ?. length || 0 ) > 0 && (
265- < span className = "typography-body-sm" >
266- { formattedSpeakers . join ( ", " ) }
267- </ span >
268- ) }
269- < span className = "mt-2 flex items-center gap-0.5 typography-body-xs" >
270- < PinIcon className = "size-4 text-pri-base" />
271- { session . venue }
272- </ span >
273- </ span >
274- </ span >
275- </ span >
276- </ a >
277- )
278- }
279-
280204function BookmarkOnSched ( ) {
281205 return (
282206 < a
0 commit comments