Enforce required fields: topic, avatar, voice, duration, speakers, podcastMode

- Updated canSubmit to require all fields: topic, presenter avatar, voice selection, duration, speakers, and podcast mode
- Removed audio_only exception - avatar now required for all modes
- Updated tooltip message in CreateActions
This commit is contained in:
ajaysi
2026-04-20 15:59:26 +05:30
parent afdbc78779
commit 1deed48484
2 changed files with 6 additions and 3 deletions

View File

@@ -253,7 +253,7 @@ export const CreateModal: React.FC<CreateModalProps> = ({ onCreate, open, defaul
setShowAIDetailsButton(topicInput.trim().length > 0 && !isUrl);
}, [topicInput, isUrl]);
// Check if avatar is present (from any source: upload, brand avatar, or generated)
// Check if avatar is present (from any source: upload, selfie, brand avatar, or asset library)
const hasAvatar = Boolean(
avatarFile || // User uploaded an image
avatarUrl || // Already processed avatar URL
@@ -267,8 +267,11 @@ export const CreateModal: React.FC<CreateModalProps> = ({ onCreate, open, defaul
const hasVoice = Boolean(selectedVoiceId);
const hasDuration = Boolean(duration > 0 && duration <= 10);
const hasSpeakers = Boolean(speakers >= 1 && speakers <= 2);
const hasPodcastMode = Boolean(podcastMode);
const canSubmit = Boolean(hasTopic && (podcastMode === "audio_only" || hasAvatar) && hasVoice && hasDuration && hasSpeakers);
// Required: topic, duration, speakers, voice, podcastMode, presenter avatar
// Avatar required for video modes; for audio_only, still require avatar for presenter display
const canSubmit = Boolean(hasTopic && hasVoice && hasDuration && hasSpeakers && hasPodcastMode && hasAvatar);
const [submitError, setSubmitError] = useState<string | null>(null);

View File

@@ -473,7 +473,7 @@ export const CreateActions: React.FC<CreateActionsProps> = ({ reset, submit, can
disabled={!canSubmit || isSubmitting}
loading={isSubmitting}
startIcon={<AutoAwesomeIcon />}
tooltip={!canSubmit ? "Complete all 4 steps: 1) Enter topic/URL, 2) Configure duration & speakers, 3) Add avatar, 4) Select voice" : "We'll start AI analysis after this click"}
tooltip={!canSubmit ? "Required: Podcast topic, presenter avatar, voice, duration, speakers, and podcast mode" : "Start AI analysis after this click"}
>
{isSubmitting ? "Analyzing..." : buttonText}
</PrimaryButton>