testing routes
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 2m23s

This commit is contained in:
2025-11-29 05:29:38 -08:00
parent 9e5c2047f7
commit bf0bf9ae21
22 changed files with 774 additions and 44 deletions

View File

@@ -35,6 +35,7 @@ import { ResetPasswordPage } from './pages/ResetPasswordPage';
import { AnonymousUserBanner } from './pages/admin/components/AnonymousUserBanner';
import { VoiceLabPage } from './pages/VoiceLabPage';
import { WhatsNewModal } from './components/WhatsNewModal';
import { FlyerCorrectionTool } from './components/FlyerCorrectionTool'; // This path is now correct after moving the file
import { QuestionMarkCircleIcon } from './components/icons/QuestionMarkCircleIcon';
/**
@@ -113,6 +114,22 @@ function App() {
const [isProfileManagerOpen, setIsProfileManagerOpen] = useState(false); // This will now control the login modal as well
const [isWhatsNewOpen, setIsWhatsNewOpen] = useState(false);
const [isVoiceAssistantOpen, setIsVoiceAssistantOpen] = useState(false);
const [isCorrectionToolOpen, setIsCorrectionToolOpen] = useState(false);
const handleDataExtractedFromCorrection = (type: 'store_name' | 'dates', value: string) => {
if (!selectedFlyer) return;
// This is a simplified update. A real implementation would involve
// making another API call to update the flyer record in the database.
// For now, we just update the local state for immediate visual feedback.
const updatedFlyer = { ...selectedFlyer };
if (type === 'store_name') {
updatedFlyer.store = { ...updatedFlyer.store!, name: value };
} else if (type === 'dates') {
// A more robust solution would parse the date string properly.
}
setSelectedFlyer(updatedFlyer);
};
const [processingStages, setProcessingStages] = useState<ProcessingStage[]>([]);
const [estimatedTime, setEstimatedTime] = useState(0);
@@ -831,6 +848,16 @@ function App() {
commitMessage={commitMessage}
/>
)}
{selectedFlyer && (
<FlyerCorrectionTool
isOpen={isCorrectionToolOpen}
onClose={() => setIsCorrectionToolOpen(false)}
imageUrl={selectedFlyer.image_url}
onDataExtracted={handleDataExtractedFromCorrection}
/>
)}
<Routes>
<Route path="/" element={
<main className="max-w-screen-2xl mx-auto py-4 px-2.5 sm:py-6 lg:py-8">
@@ -872,6 +899,7 @@ function App() {
validFrom={selectedFlyer.valid_from}
validTo={selectedFlyer.valid_to}
storeAddress={selectedFlyer.store_address}
onOpenCorrectionTool={() => setIsCorrectionToolOpen(true)}
/>
{hasData && (
<>