diff --git a/src/app/portfolio/[slug]/(portfolio)/reporting/components/FilterChips.tsx b/src/app/portfolio/[slug]/(portfolio)/reporting/components/FilterChips.tsx index 177b3cd0..41af66c3 100644 --- a/src/app/portfolio/[slug]/(portfolio)/reporting/components/FilterChips.tsx +++ b/src/app/portfolio/[slug]/(portfolio)/reporting/components/FilterChips.tsx @@ -1,12 +1,6 @@ "use client"; -import { X, Info, ChevronDown } from "lucide-react"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/app/shadcn_components/ui/tooltip"; +import { X, ChevronDown } from "lucide-react"; import { Popover, PopoverContent, @@ -20,6 +14,30 @@ import { SelectValue, } from "@/app/shadcn_components/ui/select"; import { EPC_BANDS } from "@/lib/epc/bands"; +import { InfoDot } from "./primitives"; +import { TipBody, type TipSpec } from "./tipContent"; + +/** Structured "what this filter does" copy — same shape/look as the cost ⓘs. */ +const FILTER_HELP: Record< + "reachTarget" | "lodgedBaseline" | "complianceWindow", + TipSpec +> = { + reachTarget: { + summary: + "Counts only homes whose modelled result reaches this scenario's target band.", + note: "Homes still short of target after the works drop out of every figure, so costs and outcomes cover the fully-compliant homes only.", + }, + lodgedBaseline: { + summary: + "Decides which homes need work from their official lodged EPC band on the government register, not Domna's modelled current band.", + note: "Use it to match what the register says a home needs.", + }, + complianceWindow: { + summary: + "Leaves out homes whose official (lodged) EPC already meets the band below and stays valid past the date.", + note: "The government counts these as compliant beyond then, so costs and outcomes show only the works on the remaining homes.", + }, +}; /** * Inline scenario filter chips (Screen B). State is always visible and @@ -49,12 +67,12 @@ function ToggleChip({ on, onToggle, label, - help, + tip, }: { on: boolean; onToggle: () => void; label: string; - help: string; + tip: React.ReactNode; }) { return ( } - - - - - - - {help} - - - + ); } @@ -118,7 +121,7 @@ export function FilterChips({ onChange({ ...filters, hideNonCompliant: !filters.hideNonCompliant }) } label="Only homes that reach target" - help="Counts only the homes whose modelled result actually reaches this scenario's target band. Homes still short of target after the works drop out of every figure — so costs and outcomes cover the fully-compliant homes only." + tip={} /> {/* Compliance window — editable band + date */} @@ -142,12 +145,9 @@ export function FilterChips({
Skip already-compliant homes
-

- Leave out homes whose official (lodged) EPC already meets the band - below and stays valid past the date — homes the government counts as - compliant beyond then. The costs and outcomes then show only the - works on the remaining homes. -

+
+ +