import { useState } from 'react'; import { useUser } from '@/react/hooks/useUser'; import { UploadLicenseDialog } from './UploadLicenseDialog'; import { LoadingDialog } from './LoadingDialog'; import { NonAdminUpgradeDialog } from './NonAdminUpgradeDialog'; type Step = 'uploadLicense' | 'loading' | 'getLicense'; export function UpgradeDialog({ onDismiss }: { onDismiss: () => void }) { const { isAdmin } = useUser(); const [currentStep, setCurrentStep] = useState('uploadLicense'); const component = getDialog(); return component; function getDialog() { if (!isAdmin) { return ; } switch (currentStep) { case 'getLicense': throw new Error('Not implemented'); // return ; case 'uploadLicense': return ( setCurrentStep('loading')} onDismiss={onDismiss} /> ); case 'loading': return ; default: throw new Error('step type not found'); } } }