diff --git a/web/app/new/page.tsx b/web/app/new/page.tsx index 87f1303..63f648d 100644 --- a/web/app/new/page.tsx +++ b/web/app/new/page.tsx @@ -1,18 +1,19 @@ 'use client'; import { useRouter } from 'next/navigation'; +import { useCallback } from 'react'; import ScraperTest from '@/components/ScraperTest'; import { useJobs } from '@/contexts/JobsContext'; import { JobStatus } from '@/components/ScraperTest'; export default function NewScrapePage() { const router = useRouter(); - const { addJob, refreshJobs } = useJobs(); + const { addJob } = useJobs(); - const handleJobsChange = (jobs: JobStatus[]) => { - // Add new jobs to context + const handleJobsChange = useCallback((jobs: JobStatus[]) => { + // Add new jobs to context (addJob handles deduplication) jobs.forEach(job => addJob(job)); - }; + }, [addJob]); const handleSelectReviews = (reviews: unknown[], businessName: string, jobId: string) => { // Navigate to analytics page for this job