import React from 'react'; import { useAppTranslation } from '@features/localization/renderer'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from '@renderer/components/ui/dialog'; import { Loader2 } from 'lucide-react'; type LaunchTeamDialogLoadingMode = 'launch' | 'relaunch' | 'schedule'; interface LaunchTeamDialogLoadingFallbackProps { readonly mode: LaunchTeamDialogLoadingMode; readonly teamName?: string; readonly isEditingSchedule?: boolean; readonly onClose: () => void; } export const LaunchTeamDialogLoadingFallback = ({ mode, teamName, isEditingSchedule = false, onClose, }: LaunchTeamDialogLoadingFallbackProps): React.JSX.Element => { const { t } = useAppTranslation('team'); const { t: tCommon } = useAppTranslation('common'); const title = mode === 'schedule' ? isEditingSchedule ? t('launch.title.editSchedule') : t('launch.title.createSchedule') : mode === 'relaunch' ? t('launch.title.relaunch') : t('launch.title.launch'); const description = mode === 'schedule' ? isEditingSchedule && teamName ? t('launch.description.editSchedule', { team: teamName }) : teamName ? t('launch.description.createScheduleForTeam', { team: teamName }) : t('launch.description.createSchedule') : mode === 'relaunch' ? t('launch.description.relaunchPrefix') : t('launch.description.launchPrefix'); return ( { if (!nextOpen) { onClose(); } }} > {title} {mode === 'schedule' ? ( description ) : ( <> {description} {teamName}{' '} {mode === 'relaunch' ? t('launch.description.relaunchSuffix') : t('launch.description.launchSuffix')} )}
{tCommon('states.loading')}
); };