15
15
*/
16
16
17
17
import clsx from 'clsx' ;
18
- import Image from 'next/image' ;
19
18
import Link from 'next/link' ;
20
- import LocationIcon from 'public/images/location.svg' ;
21
- import TicketPic from 'public/images/ticket.png' ;
22
- import TimeIcon from 'public/images/time.svg' ;
23
19
import ContentEditable from 'react-contenteditable' ;
24
20
25
21
import { USDTIcon } from '@/components/Icons' ;
26
22
import { ArrowRightLineIcon } from '@/components/Icons' ;
27
23
import { HTMLDecode } from '@/utils' ;
28
- import { formatTime } from '@/utils/date' ;
29
-
30
- import { countries } from '#/lib/countries' ;
31
24
32
25
import { CardTitleWidget } from '../../../course' ;
26
+ import DatePlaceWidget from '../../widgets/date-place' ;
33
27
import TagListWidget from '../../widgets/tag-list' ;
34
28
35
- export function TimeAndLocation ( { data, from, openTicket, permission, type} ) {
36
- // console.log(data)
37
-
38
- return (
39
- < >
40
- < div className = "my-2 flex items-center justify-between" >
41
- < div className = "flex items-center" >
42
- < Image src = { TimeIcon } alt = "" />
43
- < p className = "text-sm opacity-60 ml-2" > Time</ p >
44
- </ div >
45
- < div className = "h-4" >
46
- < p className = "text-sm text-gray" >
47
- { formatTime ( data . challenges_extra . course_challenges_extra_start_date * 1000 , 'YYYY/MM/DD' ) } -{ ' ' }
48
- { formatTime ( data . challenges_extra . course_challenges_extra_end_date * 1000 , 'MM/DD' ) }
49
- { data . challenges_extra . course_challenges_extra_time_zone ?. label ?. substr ( 0 , 11 ) && < span className = "text-xs h-4 py-[2px]" > { data . challenges_extra . course_challenges_extra_time_zone ?. label ?. substr ( 0 , 11 ) } </ span > }
50
- </ p >
51
- </ div >
52
- </ div >
53
- < div className = "mt-2 flex items-center justify-between gap-10" >
54
- < div className = "flex items-center" >
55
- < Image src = { LocationIcon } alt = "" />
56
- < p className = "text-sm opacity-60 ml-2" > Location</ p >
57
- </ div >
58
- < p className = "text-sm text-gray flex-1 text-right flex items-center justify-end gap-1" >
59
- {
60
- data ?. challenges_extra . course_challenges_extra_online ?
61
- 'Online'
62
- :
63
- data ?. challenges_extra . course_challenges_extra_country ?
64
- countries . find ( f => f . code === data ?. challenges_extra . course_challenges_extra_country ) ?. name
65
- + ', ' + data ?. challenges_extra . course_challenges_extra_city : ''
66
- }
67
- { ! data ?. challenges_extra . course_challenges_extra_online && from === 'rc' && ( permission ?. course_user_permission_status === 1 && type === 'challenges' ) && < Image onClick = { openTicket } height = { 12 } src = { TicketPic } alt = "" className = "cursor-pointer" /> }
68
- </ p >
69
- </ div >
70
- </ >
71
- ) ;
72
- }
73
-
74
29
function ChallengeItem ( { data } ) {
75
30
return (
76
31
< Link
@@ -91,7 +46,7 @@ function ChallengeItem({ data }) {
91
46
disabled = { true }
92
47
/>
93
48
</ h6 >
94
- < TimeAndLocation data = { data } />
49
+ < DatePlaceWidget data = { data } />
95
50
</ div >
96
51
< div className = "flex items-center justify-between py-4 px-6" >
97
52
< div className = "flex items-center gap-14" >
0 commit comments