Require podcast avatar before enabling Analyze & Continue button

- canSubmit now checks for avatar presence (uploaded, brand, or generated)
- Checks avatarFile, avatarUrl, avatarPreview, brandAvatarFromDb, brandAvatarBlobUrl
- Updated tooltip to reflect new requirement
This commit is contained in:
ajaysi
2026-03-31 19:53:09 +05:30
parent 4c206293b1
commit f737b24b49
2 changed files with 11 additions and 2 deletions

View File

@@ -269,7 +269,16 @@ export const CreateModal: React.FC<CreateModalProps> = ({ onCreate, open, defaul
};
}, [duration, speakers, knobs.bitrate, knobs.scene_length_target]);
const canSubmit = Boolean(topicInput.trim());
// Check if avatar is present (from any source: upload, brand avatar, or generated)
const hasAvatar = Boolean(
avatarFile || // User uploaded an image
avatarUrl || // Already processed avatar URL
avatarPreview || // Avatar preview available
brandAvatarFromDb || // Brand avatar from database
brandAvatarBlobUrl // Brand avatar blob URL
);
const canSubmit = Boolean(topicInput.trim() && hasAvatar);
const submit = async () => {
if (!canSubmit || isSubmitting) return;

View File

@@ -50,7 +50,7 @@ export const CreateActions: React.FC<CreateActionsProps> = ({
disabled={!canSubmit || isSubmitting}
loading={isSubmitting}
startIcon={<AutoAwesomeIcon />}
tooltip={!canSubmit ? "Enter an idea or URL to continue" : "Well start AI analysis after this click"}
tooltip={!canSubmit ? "Enter an idea/URL and add a podcast avatar to continue" : "We'll start AI analysis after this click"}
>
{isSubmitting ? "Analyzing..." : "Analyze & Continue"}
</PrimaryButton>