testing routes
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 2m23s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 2m23s
This commit is contained in:
28
src/App.tsx
28
src/App.tsx
@@ -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 && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user