import { useEffect, useState } from 'react'; import { Box, Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, FormControl, InputLabel, MenuItem, Select, Typography, } from '@mui/material'; const HF_PRICING_URL = 'https://huggingface.co/pricing'; interface JobsUpgradeDialogProps { open: boolean; mode: 'upgrade' | 'namespace'; message: string; eligibleNamespaces: string[]; onUpgrade: () => void; onDecline: () => void; onClose: () => void; onContinueWithNamespace: (namespace: string) => void; } export default function JobsUpgradeDialog({ open, mode, message, eligibleNamespaces, onUpgrade, onDecline, onClose, onContinueWithNamespace, }: JobsUpgradeDialogProps) { const [selectedNamespace, setSelectedNamespace] = useState(''); useEffect(() => { if (!open) return; setSelectedNamespace(eligibleNamespaces[0] || ''); }, [open, eligibleNamespaces]); return ( {mode === 'namespace' ? 'Choose the org for this job' : 'Jobs need Pro or a paid org'} {message} {eligibleNamespaces.length > 0 && ( Eligible namespaces {mode === 'namespace' ? ( Organization ) : ( {eligibleNamespaces.join(', ')} )} )} If you decline, the agent will have to find another way forward without `hf_jobs`. {mode === 'namespace' ? ( ) : ( )} ); }