|
| 1 | +import { Calendar, Clock } from "lucide-react"; |
| 2 | +import { |
| 3 | + AlertDialog, |
| 4 | + AlertDialogAction, |
| 5 | + AlertDialogCancel, |
| 6 | + AlertDialogContent, |
| 7 | + AlertDialogDescription, |
| 8 | + AlertDialogFooter, |
| 9 | + AlertDialogHeader, |
| 10 | + AlertDialogTitle, |
| 11 | +} from "~/components/ui/alert-dialog"; |
| 12 | + |
| 13 | +const ConfirmRegister = ({ |
| 14 | + handleConfirmSubmit, |
| 15 | + showConfirmDialog, |
| 16 | + setShowConfirmDialog, |
| 17 | + trialSlot, |
| 18 | + officialSlots, |
| 19 | +}: { |
| 20 | + handleConfirmSubmit: () => void; |
| 21 | + showConfirmDialog: boolean; |
| 22 | + setShowConfirmDialog: React.Dispatch<React.SetStateAction<boolean>>; |
| 23 | + trialSlot: string; |
| 24 | + officialSlots: string[]; |
| 25 | +}) => { |
| 26 | + return ( |
| 27 | + <AlertDialog open={showConfirmDialog} onOpenChange={setShowConfirmDialog}> |
| 28 | + <AlertDialogContent className="max-w-2xl"> |
| 29 | + <AlertDialogHeader> |
| 30 | + <AlertDialogTitle>Xác nhận đăng ký thời gian thuyết trình</AlertDialogTitle> |
| 31 | + <AlertDialogDescription> |
| 32 | + Kiểm tra lại thông tin đăng ký của bạn trước khi xác nhận. |
| 33 | + </AlertDialogDescription> |
| 34 | + </AlertDialogHeader> |
| 35 | + |
| 36 | + <div className="space-y-4 pb-4"> |
| 37 | + <div className="space-y-2"> |
| 38 | + <div className="flex items-center gap-2"> |
| 39 | + <Clock className="h-4 w-4 text-blue-500" /> |
| 40 | + <h4 className="font-semibold text-gray-900">Thuyết trình thử</h4> |
| 41 | + </div> |
| 42 | + {trialSlot ? ( |
| 43 | + <div className="rounded-md border-1 border-blue-400 bg-blue-50 p-3"> |
| 44 | + <div className="flex items-center gap-2 text-sm"> |
| 45 | + <Calendar className="h-3.5 w-3.5 text-blue-600" /> |
| 46 | + <span className="font-medium text-blue-900">{trialSlot.split("|")[0]}</span> |
| 47 | + <span className="text-blue-600"> - </span> |
| 48 | + <span className="text-blue-800">{trialSlot.split("|")[1]}</span> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + ) : ( |
| 52 | + <div className=""> |
| 53 | + <p className="text-sm text-gray-500 italic">Không đăng ký</p> |
| 54 | + </div> |
| 55 | + )} |
| 56 | + </div> |
| 57 | + |
| 58 | + <div className="space-y-2"> |
| 59 | + <div className="flex items-center gap-2"> |
| 60 | + <Clock className="h-4 w-4 text-green-600" /> |
| 61 | + <h4 className="font-semibold text-green-700">Thuyết trình chính thức</h4> |
| 62 | + </div> |
| 63 | + <div className="space-y-2"> |
| 64 | + {officialSlots.map((slot) => ( |
| 65 | + <div key={slot} className="bg-primary/10 border-primary rounded-md border-1 p-3"> |
| 66 | + <div className="flex items-center gap-2 text-sm"> |
| 67 | + <Calendar className="h-3.5 w-3.5 text-green-600" /> |
| 68 | + <span className="font-medium text-green-900">{slot.split("|")[0]}</span> |
| 69 | + <span className="text-green-600"> - </span> |
| 70 | + <span className="text-green-800">{slot.split("|")[1]}</span> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + ))} |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + |
| 77 | + <div className="rounded-md border border-amber-200 bg-amber-50 p-3"> |
| 78 | + <p className="text-sm text-amber-800"> |
| 79 | + <span className="font-semibold">Lưu ý:</span> Sau khi xác nhận, thông tin sẽ được gửi đến |
| 80 | + ban tổ chức. Đảm bảo tất cả thành viên có thể tham gia các khung giờ đã chọn. |
| 81 | + </p> |
| 82 | + </div> |
| 83 | + </div> |
| 84 | + |
| 85 | + <AlertDialogFooter> |
| 86 | + <AlertDialogCancel>Hủy</AlertDialogCancel> |
| 87 | + <AlertDialogAction onClick={handleConfirmSubmit}>Xác nhận</AlertDialogAction> |
| 88 | + </AlertDialogFooter> |
| 89 | + </AlertDialogContent> |
| 90 | + </AlertDialog> |
| 91 | + ); |
| 92 | +}; |
| 93 | + |
| 94 | +export default ConfirmRegister; |
0 commit comments