1
1
import React , { useState } from 'react' ;
2
- < < << << < HEAD
3
- import { FaAngleDown } from "react-icons/fa6" ;
4
- = === ===
5
2
import { FaAngleDown } from 'react-icons/fa6' ;
6
3
import TeamChart from '../Chart/TeamChart' ;
7
4
import ProgressBar from '../Chart/ProgressBar' ;
8
5
import UsersChart from '../Chart/usersChart' ;
9
- > >>> >>> fdc13ed ( user Growth overtime chart )
10
6
11
7
interface TeamData {
12
8
ttlName ?: string ;
@@ -27,20 +23,6 @@ interface TeamDetailsModalProps {
27
23
Teams ?: any ;
28
24
}
29
25
30
- < < << << < HEAD
31
- const TeamDetailsModal : React . FC < TeamDetailsModalProps > = ( { isOpen, onClose, teamData } ) => {
32
- if ( ! isOpen ) return null ;
33
-
34
- const [ showAttendanceSummary , setShowAttendanceSummary ] = useState ( false ) ;
35
-
36
- const handleAttendanceSummaryEnter = ( ) => {
37
- setShowAttendanceSummary ( true ) ;
38
- } ;
39
-
40
- const handleAttendanceSummaryLeave = ( ) => {
41
- setShowAttendanceSummary ( false ) ;
42
- } ;
43
- = === ===
44
26
// Add this near the top of your TeamDetailsModal component
45
27
const loginStats = {
46
28
daily : {
@@ -145,92 +127,51 @@ function TeamDetailsModal({
145
127
totalLogins : total ,
146
128
} ;
147
129
}
148
- >>> > >>> fdc13ed ( user Growth overtime chart )
149
130
150
131
return (
151
132
< div className = "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 backdrop-blur-sm" >
152
- < div className = "w-full max-w-4xl max-h-[90vh] overflow-y-auto bg-white dark:bg-gray-800 rounded-xl shadow-lg scrollbar-thumb-gray-400 dark:scrollbar-thumb-gray-600" style = { { scrollbarWidth : 'thin' } } >
133
+ < div
134
+ className = "w-full max-w-4xl max-h-[90vh] overflow-y-auto bg-white dark:bg-gray-800 rounded-xl shadow-lg scrollbar-thumb-gray-400 dark:scrollbar-thumb-gray-600"
135
+ style = { { scrollbarWidth : 'thin' } }
136
+ >
153
137
< div className = "flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700" >
154
- < div className = 'flex gap-10' >
155
- < h2 className = "text-xl font-semibold text-gray-800 dark:text-gray-200" >
138
+ < div className = "flex gap-10" >
139
+ < button
140
+ type = "button"
141
+ onClick = { ( ) => setActiveTab ( 'overview' ) }
142
+ className = { `text-xl font-semibold ${
143
+ activeTab === 'overview'
144
+ ? 'text-primary'
145
+ : 'text-gray-800 dark:text-gray-200'
146
+ } `}
147
+ >
156
148
Overview
157
- </ h2 >
158
- < h2 className = "text-xl font-semibold text-gray-800 dark:text-gray-200" >
149
+ </ button >
150
+ < button
151
+ type = "button"
152
+ onClick = { ( ) => setActiveTab ( 'logins' ) }
153
+ className = { `text-xl font-semibold ${
154
+ activeTab === 'logins'
155
+ ? 'text-primary'
156
+ : 'text-gray-800 dark:text-gray-200'
157
+ } `}
158
+ >
159
159
Logins
160
- </ h2 >
160
+ </ button >
161
161
</ div >
162
162
< button
163
+ type = "button"
163
164
onClick = { onClose }
164
165
className = "p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
165
166
>
166
- < p > Close</ p >
167
+ Close
167
168
</ button >
168
169
</ div >
169
170
170
- < div className = "p-6 space-y-4" >
171
- < div className = "grid grid-cols-2 gap-4" >
172
- < div className = "space-y-2" >
173
- < label className = "text-sm font-medium text-gray-500 dark:text-gray-400" >
174
- TTL Name
175
- </ label >
176
- < p className = "text-gray-800 dark:text-gray-200" > { teamData ?. ttlName || 'Sostene' } </ p >
177
- </ div >
178
-
179
- < div className = "space-y-2" >
180
- < label className = "text-sm font-medium text-gray-500 dark:text-gray-400" >
181
- Team Name
182
- </ label >
183
- < p className = "text-gray-800 dark:text-gray-200" > { teamData ?. team } </ p >
184
- </ div >
185
-
186
- < div className = "space-y-2" >
187
- < label className = "text-sm font-medium text-gray-500 dark:text-gray-400" >
188
- Organization
189
- </ label >
190
- < p className = "text-gray-800 dark:text-gray-200" > { teamData ?. organization || 'Organization Name' } </ p >
191
- </ div >
192
-
193
- < div className = "space-y-2" >
194
- < label className = "text-sm font-medium text-gray-500 dark:text-gray-400" >
195
- Program
196
- </ label >
197
- < p className = "text-gray-800 dark:text-gray-200" > { teamData ?. program || 'Program Name' } </ p >
198
- </ div >
199
-
200
- < div className = "space-y-2" >
201
- < label className = "text-sm font-medium text-gray-500 dark:text-gray-400" >
202
- Phase
203
- </ label >
204
- < p className = "text-gray-800 dark:text-gray-200" > { teamData ?. phase || 'Current Phase' } </ p >
205
- </ div >
206
-
207
- < div className = "space-y-2" >
208
- < label className = "text-sm font-medium text-gray-500 dark:text-gray-400" >
209
- Cohort
210
- </ label >
211
- < p className = "text-gray-800 dark:text-gray-200" > { teamData ?. cohort || 'Current Cohort' } </ p >
212
- </ div >
213
- </ div >
214
-
215
- < div className = "space-y-4 mt-6" >
216
- < div className = "space-y-2" >
217
- < label className = "text-sm font-medium text-gray-500 dark:text-gray-400" >
218
- Users
219
- </ label >
171
+ < div className = "p-6" >
172
+ { activeTab === 'overview' && (
173
+ < div >
220
174
< div className = "grid grid-cols-2 gap-4" >
221
- < < << << < HEAD
222
- < div className = "p-4 bg-green-50 dark:bg-green-900/20 rounded-lg" >
223
- < p className = "text-sm text-gray-600 dark:text-gray-400" > Active Members</ p >
224
- < p className = "text-xl font-semibold text-green-600 dark:text-green-400" >
225
- { teamData ?. activeUsers || '0' }
226
- </ p >
227
- </ div >
228
- < div className = "p-4 bg-red-50 dark:bg-red-900/20 rounded-lg" >
229
- < p className = "text-sm text-gray-600 dark:text-gray-400" > Dropped Members</ p >
230
- < p className = "text-xl font-semibold text-red-600 dark:text-red-400" >
231
- { teamData ?. droppedUsers || '0' }
232
- </ p >
233
- =======
234
175
{ [
235
176
[ 'TTL Name' , CurrentTeam [ 0 ] ?. ttl ?. profile ?. name || 'Sostene' ] ,
236
177
[ 'Team Name' , selectedteam ?. teams || 'Team Name' ] ,
@@ -318,40 +259,48 @@ function TeamDetailsModal({
318
259
{ average || '0' } / 5.0
319
260
</ p >
320
261
</ div >
321
- >>> >>> > fdc13ed ( user Growth overtime chart )
322
262
</ div >
323
263
</ div >
324
264
</ div >
325
-
326
- < div
327
- className = "space-y-2 relative"
328
- onMouseEnter = { handleAttendanceSummaryEnter }
329
- onMouseLeave = { handleAttendanceSummaryLeave }
330
- >
331
- < label className = "text-sm font-medium text-gray-500 dark:text-gray-400" >
332
- Attendance Summary
333
- < FaAngleDown className = { `ml-2 inline-block ${ showAttendanceSummary ? 'rotate-180' : '' } ` } />
334
- </ label >
335
- { showAttendanceSummary && (
336
- < div className = "absolute z-10 bg-white dark:bg-gray-800 p-4 rounded-lg shadow-lg w-[200px]" >
337
- < p > Quality: 1.5</ p >
338
- < p > Quantity: 2.3</ p >
339
- < p > Professionalism: 3.1</ p >
340
- </ div >
341
- << < < << < HEAD
342
- ) }
343
- </ div >
344
-
345
- < div className = "space-y-2" >
346
- < label className = "text-sm font-medium text-gray-500 dark:text-gray-400" >
347
- Rating Summary
348
- </ label >
349
- < div className = "p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg" >
350
- < p className = "text-lg font-semibold text-blue-600 dark:text-blue-400" >
351
- { teamData ?. rating || '4.5' } / 5.0
352
- </ p >
265
+ ) }
266
+
267
+ { activeTab === 'logins' && (
268
+ < div className = "flex flex-col items-center w-full" >
269
+ < div className = "w-[24rem] py-2 flex justify-center items-center gap-2 rounded-full border border-gray-200 dark:border-gray-700" >
270
+ < button
271
+ type = "button"
272
+ onClick = { ( ) => setTimeframe ( 'daily' ) }
273
+ className = { `w-[7rem] px-4 py-1 border border-gray-600 rounded-full transition-colors ${
274
+ timeframe === 'daily'
275
+ ? 'bg-primary text-white'
276
+ : 'text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700'
277
+ } `}
278
+ >
279
+ Daily
280
+ </ button >
281
+ < button
282
+ type = "button"
283
+ onClick = { ( ) => setTimeframe ( 'weekly' ) }
284
+ className = { `w-[7rem] px-4 py-1 border border-gray-600 rounded-full transition-colors ${
285
+ timeframe === 'weekly'
286
+ ? 'bg-primary text-white'
287
+ : 'text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700'
288
+ } `}
289
+ >
290
+ Weekly
291
+ </ button >
292
+ < button
293
+ type = "button"
294
+ onClick = { ( ) => setTimeframe ( 'monthly' ) }
295
+ className = { `w-[7rem] px-4 py-1 border border-gray-600 rounded-full transition-colors ${
296
+ timeframe === 'monthly'
297
+ ? 'bg-primary text-white'
298
+ : 'text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700'
299
+ } `}
300
+ >
301
+ Monthly
302
+ </ button >
353
303
</ div >
354
- =======
355
304
< div className = "mt-6 w-full px-4 flex flex-col justify-center" >
356
305
< div className = "flex w-full justify-center gap-5" >
357
306
< h3 className = "text-lg font-semibold text-gray-800 dark:text-gray-200 mb-2" >
@@ -382,13 +331,12 @@ function TeamDetailsModal({
382
331
CurrentTeam = { CurrentTeam }
383
332
loginsbyDate = { loginsbyDate }
384
333
/>
385
- >>> >>> > fdc13ed ( user Growth overtime chart )
386
334
</ div >
387
- </ div >
335
+ ) }
388
336
</ div >
389
337
</ div >
390
338
</ div >
391
339
) ;
392
- } ;
340
+ }
393
341
394
- export default TeamDetailsModal ;
342
+ export default TeamDetailsModal ;
0 commit comments