diff --git a/frontend/src/pages/GenerateCalendar.tsx b/frontend/src/pages/GenerateCalendar.tsx index ff88184..34b8473 100644 --- a/frontend/src/pages/GenerateCalendar.tsx +++ b/frontend/src/pages/GenerateCalendar.tsx @@ -1,6 +1,247 @@ /** - * Pagina Genera Calendario (stub — completata nel Task 2c) + * Pagina Genera Calendario. + * + * Flusso: + * 1. Utente compila form (obiettivo + settimane) + * 2. Submit chiama POST /api/generate/bulk → ritorna {job_id} (202 Accepted) + * 3. Mostra ProgressIndicator con polling ogni 2s su job_id + * 4. Quando il job completa → navigate a /risultati/:jobId + * + * Il pulsante Genera è disabilitato se API key non configurata. */ + +import { AlertTriangle, Loader2 } from 'lucide-react' +import { useState } from 'react' +import { Link, useNavigate } from 'react-router-dom' +import { useGenerateCalendar, useSettings, useSettingsStatus } from '../api/hooks' +import { ProgressIndicator } from '../components/ProgressIndicator' +import type { CalendarRequest } from '../types' + export function GenerateCalendar() { - return
+ Claude sta generando i 13 caroselli Instagram. Ci vorranno alcuni minuti. +
++ Non chiudere questa pagina. Job ID: {jobId} +
++ Genera 13 caroselli Instagram strategici basati sul framework Persuasion Nurturing e Schwartz. +
+API key Claude non configurata
++ + Configura la tua API key nelle Impostazioni + {' '} + per abilitare la generazione. +
++ Genera un carosello Instagram con parametri personalizzati. Utile per test e rigenerazione. +
++ + Configura la tua API key + {' '} + per abilitare la generazione. +
+{jobData.campagna}
++ Nessun risultato disponibile. +
+ ) : ( + localResults.map((result) => ( +