11import React , { useState } from "react" ;
2- import { useMutation } from "@tanstack/react-query" ;
2+ import { useMutation , useQueryClient } from "@tanstack/react-query" ;
33import { Calendar , Clock , Send } from "lucide-react" ;
44import { Button } from "~/components/ui/button" ;
55import { RadioGroup , RadioGroupItem } from "~/components/ui/radio-group" ;
@@ -17,22 +17,33 @@ interface TimeSlots {
1717}
1818
1919const trialTimeSlots : TimeSlots = {
20- "17/01/2026" : [ "7:00 - 7:45" , "8:00 - 8:45" , "9:00 - 9:45" , "10:00 - 10:45" ] ,
21- "18/01/2026" : [ "7:00 - 7:45" , "8:00 - 8:45" , "9:00 - 9:45" , "10:00 - 10:45" ] ,
22- "19/01/2026" : [ "7:00 - 7:45" , "8:00 - 8:45" , "9:00 - 9:45" , "10:00 - 10:45" ] ,
23- "20/01/2026" : [ "7:00 - 7:45" , "8:00 - 8:45" , "9:00 - 9:45" , "10:00 - 10:45" ] ,
20+ "17/01/2026" : [ "10h05 - 10h50" , "16h05 - 16h50" , "19h05 - 19h50" , "20h05 - 20h50" ] ,
21+ "18/01/2026" : [ "15h05 - 15h50" , "16h05 - 16h50" , "19h05 - 19h50" , "20h05 - 20h50" ] ,
22+ "19/01/2026" : [ "09h05 - 09h50" , "10h05 - 10h50" , "19h05 - 19h50" , "20h05 - 20h50" ] ,
23+ "20/01/2026" : [ "19h05 - 19h50" , "20h05 - 20h50" ] ,
24+ "21/01/2026" : [ "19h05 - 19h50" , "20h05 - 20h50" ] ,
2425} ;
2526
2627const officialTimeSlots : TimeSlots = {
27- "17/01/2026" : [ "13:00 - 13:45" , "14:00 - 14:45" ] ,
28- "18/01/2026" : [ "13:00 - 13:45" , "14:00 - 14:45" ] ,
29- "19/01/2026" : [ "13:00 - 13:45" , "14:00 - 14:45" ] ,
30- "20/01/2026" : [ "13:00 - 13:45" , "14:00 - 14:45" ] ,
28+ "24/01/2026" : [ "18h - 19h" , "19h15 - 20h15" ] ,
29+ "26/01/2026" : [ "18h - 19h" , "19h15 - 20h15" ] ,
30+ "27/01/2026" : [ "18h - 19h" , "19h15 - 20h15" ] ,
31+ "28/01/2026" : [ "18h - 19h" , "19h15 - 20h15" ] ,
32+ "29/01/2026" : [ "18h - 19h" , "19h15 - 20h15" ] ,
33+ "30/01/2026" : [ "18h - 19h" , "19h15 - 20h15" ] ,
34+ "31/01/2026" : [ "18h - 19h" , "19h15 - 20h15" ] ,
3135} ;
3236
33- const FormRegisterPresent = ( ) => {
37+ const FormRegisterPresent = ( {
38+ isReload,
39+ setIsReload,
40+ } : {
41+ isReload : boolean ;
42+ setIsReload : React . Dispatch < React . SetStateAction < boolean > > ;
43+ } ) => {
3444 const userInfo = useAppSelector ( ( state ) => state . user . userInfo ) ;
3545 const teamId = userInfo . candidate ?. teamId || "" ;
46+ const queryClient = useQueryClient ( ) ;
3647
3748 const [ trialSlot , setTrialSlot ] = useState < string > ( "" ) ;
3849 const [ officialSlots , setOfficialSlots ] = useState < string [ ] > ( [ ] ) ;
@@ -48,9 +59,11 @@ const FormRegisterPresent = () => {
4859 } ) ;
4960 } ,
5061 onSuccess : ( ) => {
62+ queryClient . invalidateQueries ( { queryKey : [ "schedulePresentation" , teamId ] } ) ;
5163 Notification . success ( {
5264 text : "Đăng ký thời gian thuyết trình thành công!" ,
5365 } ) ;
66+ setIsReload ( ! isReload ) ;
5467 setTrialSlot ( "" ) ;
5568 setOfficialSlots ( [ ] ) ;
5669 } ,
@@ -101,13 +114,13 @@ const FormRegisterPresent = () => {
101114 </ div >
102115 < p className = "text-sm text-gray-600" >
103116 Chọn < span className = "font-semibold" > MỘT</ span > khung giờ để thuyết trình thử nghiệm và nhận
104- phản hồi từ mentor .
117+ phản hồi từ Ban Giám Khảo .
105118 </ p >
106119 < div className = "rounded-md border-l-4 border-blue-400 bg-blue-50 p-3" >
107120 < p className = "text-xs text-blue-800" >
108- < span className = "font-semibold" > Lưu ý:</ span > Chỉ có { " " }
109- < span className = "font-bold" > 10 slot</ span > thuyết trình thử cho toàn bộ các nhóm. Mỗi nhóm
110- chỉ được chọn 1 khung giờ tham gia.
121+ < span className = "font-semibold" > Lưu ý:</ span > Chỉ còn { " " }
122+ < span className = "font-bold" > 10 slot</ span > thuyết trình thử. Hãy chọn một khung giờ phù hợp
123+ có đủ tất cả các thành viên trong nhóm để tham gia.
111124 </ p >
112125 </ div >
113126
0 commit comments