diff --git a/tradein-mvp/frontend/src/app/v2/page.tsx b/tradein-mvp/frontend/src/app/v2/page.tsx index 9004b698..b2fe36a3 100644 --- a/tradein-mvp/frontend/src/app/v2/page.tsx +++ b/tradein-mvp/frontend/src/app/v2/page.tsx @@ -10,9 +10,10 @@ // a pending or errored street-deals / analytics call degrades its section to a // fallback inside the mapper instead of blanking the page. -import { useMemo, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import type { CSSProperties, ReactNode } from "react"; import { useRouter } from "next/navigation"; +import { useQueryClient } from "@tanstack/react-query"; import { tokens } from "@/components/trade-in/v2/tokens"; import TopNav from "@/components/trade-in/v2/TopNav"; @@ -25,11 +26,13 @@ import SectionOverlay from "@/components/trade-in/v2/SectionOverlay"; import { LocationDrawer } from "@/components/trade-in/v2/LocationDrawer"; import type { Analytics, ObjectInfo, Report } from "@/components/trade-in/v2/types"; import type { + CacheData, HistoryData, SourcesData, } from "@/components/trade-in/v2/mappers"; import { mapAnalytics, + mapCache, mapHistory, mapObject, mapReport, @@ -45,6 +48,7 @@ import type { import { HTTPError } from "@/lib/api"; import { useEstimate, + useEstimateHistory, useEstimateHouseAnalytics, useEstimateMutation, useEstimatePlacementHistory, @@ -52,6 +56,7 @@ import { useSalesVsListings, useStreetDeals, } from "@/lib/trade-in-api"; +import { useQuota } from "@/lib/useQuota"; // OUTER HUD FRAME + 4 corner brackets (design lines 31-37). Decorative, // non-interactive overlay drawn over the artboard gradient. The frame has @@ -372,6 +377,7 @@ function readUrlId(): string | null { export default function TradeInV2Page() { const router = useRouter(); + const queryClient = useQueryClient(); const [nav, setNav] = useState(0); const [drawerOpen, setDrawerOpen] = useState(false); @@ -383,6 +389,13 @@ export default function TradeInV2Page() { const urlId = readUrlId(); + // Post-mount flag: readUrlId() is null on SSR but a UUID on the client's first + // render, so any structure that depends on the id (e.g. the PDF vs disabled + // + {pdfBtnInner} + + ) : ( + + )}