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