Download components/ConfirmationModal.tsx from duccimane/viewsurge: direct link, hf CLI and curl.
- Browser
- Download file 2.86 kB
-
https://huggingface.co/spaces/duccimane/viewsurge/resolve/main/components/ConfirmationModal.tsx
- Command line
-
hf download hf://spaces/duccimane/viewsurge/components/ConfirmationModal.tsx
-
curl -L -o ConfirmationModal.tsx https://huggingface.co/spaces/duccimane/viewsurge/resolve/main/components/ConfirmationModal.tsx
2.86 kB
| import React from 'react'; | |
| interface ConfirmationModalProps { | |
| isOpen: boolean; | |
| onClose: () => void; | |
| onConfirm: () => void; | |
| viewCount: number; | |
| } | |
| const ConfirmationModal: React.FC<ConfirmationModalProps> = ({ isOpen, onClose, onConfirm, viewCount }) => { | |
| if (!isOpen) return null; | |
| return ( | |
| <div className="fixed inset-0 z-50 flex items-center justify-center p-4"> | |
| <div | |
| className="absolute inset-0 bg-gray-200/60 dark:bg-black/80 backdrop-blur-md transition-opacity duration-300" | |
| onClick={onClose} | |
| ></div> | |
| <div className="relative w-full max-w-sm bg-white dark:bg-black/90 backdrop-blur-xl rounded-3xl shadow-[0_0_40px_rgba(57,255,20,0.15)] ring-1 ring-gray-900/5 dark:ring-white/10 p-6 overflow-hidden border border-gray-100 dark:border-white/10"> | |
| <div className="text-center space-y-5 py-2"> | |
| <h3 className="text-xl font-tech font-bold text-gray-900 dark:text-white">Confirm Transaction</h3> | |
| <div className="py-6 bg-gray-50 dark:bg-white/5 rounded-2xl border border-dashed border-gray-200 dark:border-white/10 relative overflow-hidden group"> | |
| {/* Glow effect inside cost box */} | |
| <div className="absolute inset-0 bg-brand-start/5 opacity-0 group-hover:opacity-100 transition-opacity"></div> | |
| <span className="block text-[10px] text-gray-400 dark:text-gray-500 uppercase tracking-widest font-bold mb-1">Total Cost</span> | |
| <span className="block text-4xl font-tech font-bold text-gray-900 dark:text-white mt-1 tracking-tight"> | |
| {viewCount.toLocaleString()} | |
| </span> | |
| <span className="text-xs text-brand-start font-bold uppercase tracking-wide mt-1 inline-block px-2 py-0.5 rounded-full bg-brand-start/10">Credits</span> | |
| </div> | |
| <p className="text-xs text-gray-500 dark:text-gray-400 px-4 leading-relaxed"> | |
| This action is irreversible. Traffic delivery will begin immediately upon confirmation. | |
| </p> | |
| </div> | |
| <div className="grid grid-cols-2 gap-3 mt-6"> | |
| <button | |
| onClick={onClose} | |
| className="py-3.5 rounded-xl font-semibold text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-50 dark:hover:bg-white/5 transition-colors" | |
| > | |
| Cancel | |
| </button> | |
| <button | |
| onClick={onConfirm} | |
| className="py-3.5 rounded-xl font-semibold text-sm text-black bg-brand-gradient shadow-[0_0_20px_rgba(57,255,20,0.4)] hover:shadow-[0_0_25px_rgba(57,255,20,0.6)] hover:scale-[1.02] transition-all" | |
| > | |
| Confirm | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| ); | |
| }; | |
| export default ConfirmationModal; |