@@ -21,6 +21,7 @@ import {
2121 TrendingUp ,
2222 UserPlus ,
2323 Users ,
24+ ExternalLink ,
2425} from "lucide-react" ;
2526import { toast } from "react-hot-toast" ;
2627
@@ -56,6 +57,7 @@ interface ProjectData {
5657 project : {
5758 id : string ;
5859 name : string ;
60+ meeting_link ?: string | null ;
5961 } ;
6062 teamLead : {
6163 data : SimpleMemberData | null ;
@@ -134,46 +136,47 @@ const TeamDetailView = ({ projectData }: TeamDetailViewProps) => {
134136 }
135137 } , [ projectInfo . id , viewMode ] ) ;
136138
137- // Format schedule for display
138- const formatSchedule = ( ) => {
139- if (
140- ! currentSchedule ||
141- ! currentSchedule . selectedDays ||
142- currentSchedule . selectedDays . length === 0
143- )
144- return null ;
145-
146- const weekDays = [
147- { value : "monday" , label : "Monday" , short : "Mon" } ,
148- { value : "tuesday" , label : "Tuesday" , short : "Tue" } ,
149- { value : "wednesday" , label : "Wednesday" , short : "Wed" } ,
150- { value : "thursday" , label : "Thursday" , short : "Thu" } ,
151- { value : "friday" , label : "Friday" , short : "Fri" } ,
152- { value : "saturday" , label : "Saturday" , short : "Sat" } ,
153- { value : "sunday" , label : "Sunday" , short : "Sun" } ,
154- ] ;
155-
156- const selectedDaysDisplay = currentSchedule . selectedDays
157- . map ( ( day ) => weekDays . find ( ( d ) => d . value === day ) ?. short )
158- . filter ( Boolean )
159- . join ( ", " ) ;
160-
161- // Convert military time to 12-hour format
162- const convertTo12Hour = ( time24 : string ) => {
163- const parts = time24 . split ( ":" ) ;
164- const hours = parts [ 0 ] || "0" ;
165- const minutes = parts [ 1 ] || "00" ;
166- const hour = parseInt ( hours , 10 ) ;
167- const ampm = hour >= 12 ? "PM" : "AM" ;
168- const hour12 = hour % 12 || 12 ; // Convert 0 to 12 for midnight
169- return `${ hour12 } :${ minutes } ${ ampm } ` ;
170- } ;
171-
172- const formattedTime = convertTo12Hour ( currentSchedule . time ) ;
173139
174- return `${ selectedDaysDisplay } at ${ formattedTime } @ Discord` ;
140+ // Format schedule for display
141+ const formatSchedule = ( ) => {
142+ if (
143+ ! currentSchedule ||
144+ ! currentSchedule . selectedDays ||
145+ currentSchedule . selectedDays . length === 0
146+ )
147+ return null ;
148+
149+ const weekDays = [
150+ { value : "monday" , label : "Monday" , short : "Mon" } ,
151+ { value : "tuesday" , label : "Tuesday" , short : "Tue" } ,
152+ { value : "wednesday" , label : "Wednesday" , short : "Wed" } ,
153+ { value : "thursday" , label : "Thursday" , short : "Thu" } ,
154+ { value : "friday" , label : "Friday" , short : "Fri" } ,
155+ { value : "saturday" , label : "Saturday" , short : "Sat" } ,
156+ { value : "sunday" , label : "Sunday" , short : "Sun" } ,
157+ ] ;
158+
159+ const selectedDaysDisplay = currentSchedule . selectedDays
160+ . map ( ( day ) => weekDays . find ( ( d ) => d . value === day ) ?. short )
161+ . filter ( Boolean )
162+ . join ( ", " ) ;
163+
164+ // Convert military time to 12-hour format
165+ const convertTo12Hour = ( time24 : string ) => {
166+ const parts = time24 . split ( ":" ) ;
167+ const hours = parts [ 0 ] || "0" ;
168+ const minutes = parts [ 1 ] || "00" ;
169+ const hour = parseInt ( hours , 10 ) ;
170+ const ampm = hour >= 12 ? "PM" : "AM" ;
171+ const hour12 = hour % 12 || 12 ; // Convert 0 to 12 for midnight
172+ return `${ hour12 } :${ minutes } ${ ampm } ` ;
175173 } ;
176174
175+ const formattedTime = convertTo12Hour ( currentSchedule . time ) ;
176+
177+ return `${ selectedDaysDisplay } at ${ formattedTime } ` ;
178+ } ;
179+
177180 const handleOpenAddModal = ( ) => {
178181 setShowAddModal ( true ) ;
179182 } ;
@@ -425,13 +428,28 @@ const TeamDetailView = ({ projectData }: TeamDetailViewProps) => {
425428 < div className = "rounded-lg bg-blue-100 p-2 dark:bg-blue-900/50" >
426429 < CalendarDays className = "h-5 w-5 text-blue-600 dark:text-blue-400" />
427430 </ div >
428- < div >
431+ < div className = "flex-1" >
429432 < p className = "text-sm font-medium text-gray-900 dark:text-white" >
430433 Meeting Schedule
431434 </ p >
432- < p className = "mt-0.5 flex items-center gap-1.5 text-sm text-gray-600 dark:text-gray-400" >
435+ < p className = "mt-0.5 flex flex-wrap items-center gap-1.5 text-sm text-gray-600 dark:text-gray-400" >
433436 < Clock className = "h-3.5 w-3.5" />
434- { formatSchedule ( ) }
437+ < span > { formatSchedule ( ) } @</ span >
438+ { projectInfo . meeting_link ? (
439+ < a
440+ href = { projectInfo . meeting_link }
441+ target = "_blank"
442+ rel = "noopener noreferrer"
443+ className = "inline-flex items-center gap-1 text-blue-600 hover:text-blue-700 hover:underline dark:text-blue-400 dark:hover:text-blue-300"
444+ >
445+ { projectInfo . meeting_link }
446+ < ExternalLink className = "h-3 w-3" />
447+ </ a >
448+ ) : (
449+ < span className = "text-gray-500 dark:text-gray-500" >
450+ No link set
451+ </ span >
452+ ) }
435453 </ p >
436454 </ div >
437455 </ div >
0 commit comments