diff --git a/.replit b/.replit index ffeb98a..1eb06e0 100644 --- a/.replit +++ b/.replit @@ -26,6 +26,10 @@ externalPort = 3000 localPort = 43245 externalPort = 3001 +[[ports]] +localPort = 44513 +externalPort = 3003 + [env] PORT = "5000" diff --git a/client/src/pages/new-post.tsx b/client/src/pages/new-post.tsx index a124fbd..89066ca 100644 --- a/client/src/pages/new-post.tsx +++ b/client/src/pages/new-post.tsx @@ -23,6 +23,8 @@ export default function NewPost() { const [selectedMedia, setSelectedMedia] = useState(null); const [selectedPages, setSelectedPages] = useState([]); const [scheduledDate, setScheduledDate] = useState(''); + const [generatedVariants, setGeneratedVariants] = useState([]); + const [postText, setPostText] = useState(''); const { data: pages = [] } = useQuery({ queryKey: ['/api/pages'], @@ -36,9 +38,11 @@ export default function NewPost() { mutationFn: (productInfo: string) => apiRequest('POST', '/api/ai/generate', { productInfo }), onSuccess: (data: any) => { + const variants = data.variants || []; + setGeneratedVariants(variants); toast({ title: "Texte généré", - description: `${data.variations?.length || 0} variations créées`, + description: `${variants.length} variations créées`, }); queryClient.invalidateQueries({ queryKey: ['/api/ai/generations'] }); }, @@ -83,7 +87,7 @@ export default function NewPost() { }; const handleCreatePost = () => { - if (!productInfo.trim()) { + if (!postText.trim()) { toast({ title: "Contenu requis", description: "Veuillez saisir le contenu de la publication", @@ -93,11 +97,19 @@ export default function NewPost() { } createPostMutation.mutate({ - content: productInfo, + content: postText, scheduledFor: scheduledDate || undefined, }); }; + const handleUseVariant = (text: string) => { + setPostText(text); + toast({ + title: "Texte sélectionné", + description: "Le texte a été ajouté à votre publication", + }); + }; + return (
{sidebarOpen && ( @@ -156,6 +168,57 @@ export default function NewPost() { + + + Texte de la publication + Écrivez ou générez le texte de votre publication + + +