diff --git a/src/pages/demand/AISearch.tsx b/src/pages/demand/AISearch.tsx index 8137c95..e34c4ce 100644 --- a/src/pages/demand/AISearch.tsx +++ b/src/pages/demand/AISearch.tsx @@ -13,7 +13,7 @@ import { } from '@mui/material' import { Sparkles, ArrowRight } from 'lucide-react' import { useNavigate } from 'react-router' -import { MockupAIServiceProvider, type CriteriaExtractionResult } from '../../services/aiService' +import { aiService, type CriteriaExtractionResult } from '../../services/aiService' type Step = 'input' | 'extracting' | 'review' | 'done' @@ -39,7 +39,8 @@ export default function AISearch() { const handleAnalyze = async () => { setStep('extracting') await new Promise(r => setTimeout(r, 1500)) - const result = await MockupAIServiceProvider.extractCriteria(inputText) + const resp = await aiService.extractCriteria(inputText) + const result = resp.data setExtractedCriteria(result) setStep('review') } diff --git a/src/pages/demand/Compare.tsx b/src/pages/demand/Compare.tsx index 5189c2e..b57ed6e 100644 --- a/src/pages/demand/Compare.tsx +++ b/src/pages/demand/Compare.tsx @@ -1,3 +1,4 @@ +import type { ReactNode } from 'react' import { Box, Button, @@ -58,12 +59,12 @@ function getRiskLabel(risk?: RiskLevel): string { interface CompareRow { label: string getValue: (p: Property) => string | number | null - format?: (v: string | number | null, p: Property) => React.ReactNode + format?: (v: string | number | null, p: Property) => ReactNode isHigherBetter?: boolean isLowerBetter?: boolean } -function NumericCell({ value, isBest }: { value: React.ReactNode; isBest: boolean }) { +function NumericCell({ value, isBest }: { value: ReactNode; isBest: boolean }) { return ( compareProperties.find(p => p.id === id)) - .filter((p): p is Property => p !== null) + .filter((p): p is Property => p !== undefined) if (isLoading) { return (