import { Box, Button, Typography } from '@mui/material'; import OpenInNewIcon from '@mui/icons-material/OpenInNew'; import CreditCardIcon from '@mui/icons-material/CreditCard'; import ReplayIcon from '@mui/icons-material/Replay'; import CloseIcon from '@mui/icons-material/Close'; const HF_BILLING_URL = 'https://huggingface.co/settings/billing'; interface JobsUpgradeDialogProps { open: boolean; message: string; /** True after the user clicked "Add credits" — the visibility-change auto-retry * in the parent uses this; it is unused inside the screen itself, which always * shows both actions ("Add credits" and "I've added credits"). */ awaitingTopUp: boolean; onUpgrade: () => void; onRetry: () => void; onClose: () => void; } export default function JobsUpgradeDialog({ open, message, awaitingTopUp, onUpgrade, onRetry, onClose, }: JobsUpgradeDialogProps) { if (!open) return null; const primarySx = { bgcolor: 'var(--text)', color: 'var(--bg)', fontWeight: 700, fontSize: '0.85rem', textTransform: 'none' as const, px: 2.5, py: 1, borderRadius: '10px', boxShadow: 'none', '&:hover': { bgcolor: 'var(--text)', opacity: 0.9, boxShadow: 'none' }, }; const secondarySx = { bgcolor: 'transparent', color: 'var(--text)', fontWeight: 600, fontSize: '0.85rem', textTransform: 'none' as const, px: 2.5, py: 1, borderRadius: '10px', border: '1px solid var(--border-hover)', '&:hover': { bgcolor: 'var(--hover-bg)', borderColor: 'var(--border-hover)' }, }; return ( {awaitingTopUp ? 'Resume when you’re ready' : 'Add credits to launch this job'} {awaitingTopUp ? 'Once your top-up is through, click below to resume — the agent will pick the run back up where it left off.' : message || 'Hugging Face Jobs need credits on the namespace running them. Job credits are separate from HF Pro membership. Add some, then resume.'} ); }