feat: message generate pochette
This commit is contained in:
@@ -203,6 +203,7 @@ const PouchReady = () => {
|
||||
: []
|
||||
const isCoverLoading = isGenerating && !hasGeneratedOptions && !coverPreviewUrl
|
||||
const coverProgressValue = Math.max(0, Math.min(100, Math.round(coverProgress)))
|
||||
const isGenerationStartPending = isAwaitingGenerationStart && !isGenerating
|
||||
|
||||
useEffect(() => {
|
||||
const clearProgressInterval = () => {
|
||||
@@ -617,14 +618,28 @@ const PouchReady = () => {
|
||||
{isEditing ? (
|
||||
<View style={{ gap: 12 }}>
|
||||
<BorderGradientButton
|
||||
title={isGenerating ? 'Génération en cours...' : 'Regénérer la pochette'}
|
||||
title={
|
||||
isGenerationStartPending
|
||||
? 'Préparation en cours...'
|
||||
: isGenerating
|
||||
? 'Génération en cours...'
|
||||
: 'Regénérer la pochette'
|
||||
}
|
||||
icon={icons.stars}
|
||||
onPress={requestCoverGeneration}
|
||||
disabled={isGenerating}
|
||||
disabled={isGenerating || isGenerationStartPending}
|
||||
/>
|
||||
{isGenerationStartPending && (
|
||||
<View style={styles.generationPendingRow}>
|
||||
<ActivityIndicator size="small" color={Palette.white} />
|
||||
<Text style={styles.generationPendingLabel}>
|
||||
Lancement de la génération de ta pochette...
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
<Pressable
|
||||
onPress={() => setIsEditing(false)}
|
||||
disabled={isGenerating}
|
||||
disabled={isGenerating || isGenerationStartPending}
|
||||
style={{ alignSelf: 'center', padding: 8 }}
|
||||
>
|
||||
<Text style={{ color: Palette.gray, fontFamily: FONT_FAMILY.InterMedium }}>
|
||||
@@ -633,12 +648,28 @@ const PouchReady = () => {
|
||||
</Pressable>
|
||||
</View>
|
||||
) : !hasGeneratedOptions ? (
|
||||
<View style={{ gap: 12 }}>
|
||||
<BorderGradientButton
|
||||
title={isGenerating ? 'Génération en cours...' : 'Générer la pochette'}
|
||||
title={
|
||||
isGenerationStartPending
|
||||
? 'Préparation en cours...'
|
||||
: isGenerating
|
||||
? 'Génération en cours...'
|
||||
: 'Générer la pochette'
|
||||
}
|
||||
icon={icons.stars}
|
||||
onPress={requestCoverGeneration}
|
||||
disabled={isGenerating}
|
||||
disabled={isGenerating || isGenerationStartPending}
|
||||
/>
|
||||
{isGenerationStartPending && (
|
||||
<View style={styles.generationPendingRow}>
|
||||
<ActivityIndicator size="small" color={Palette.white} />
|
||||
<Text style={styles.generationPendingLabel}>
|
||||
Lancement de la génération de ta pochette...
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
) : (
|
||||
<>
|
||||
<View style={{ flexDirection: 'column', gap: 12, width: '100%' }}>
|
||||
@@ -646,13 +677,13 @@ const PouchReady = () => {
|
||||
<BorderGradientButton
|
||||
title="Regénérer une autre proposition"
|
||||
onPress={handleRegenerateSameStyle}
|
||||
disabled={isGenerating}
|
||||
disabled={isGenerating || isGenerationStartPending}
|
||||
textStyle={{ fontSize: 13 }}
|
||||
/>
|
||||
<BorderGradientButton
|
||||
title="Pas satisfait ? Modifier ma demande"
|
||||
onPress={() => setIsEditing(true)}
|
||||
disabled={isGenerating}
|
||||
disabled={isGenerating || isGenerationStartPending}
|
||||
textStyle={{ fontSize: 13 }}
|
||||
/>
|
||||
</View>
|
||||
@@ -867,6 +898,19 @@ const styles = StyleSheet.create({
|
||||
coverProgressBar: {
|
||||
width: '100%',
|
||||
},
|
||||
generationPendingRow: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: 8,
|
||||
},
|
||||
generationPendingLabel: {
|
||||
color: Palette.white,
|
||||
fontSize: 13,
|
||||
fontFamily: FONT_FAMILY.InterRegular,
|
||||
textAlign: 'center',
|
||||
opacity: 0.9,
|
||||
},
|
||||
customInputWrapper: {
|
||||
alignSelf: 'stretch',
|
||||
borderRadius: 18,
|
||||
|
||||
Reference in New Issue
Block a user