/** Human labels for provenance / claim field names (API camelCase; snake_case tolerated). Shared by the provenance table and the evidence drawer. */ export const FIELD_LABEL: Record = { name: "Name", status: "Status", facilityType: "Type", itCapacityMw: "IT capacity", totalPowerMw: "Total power", plannedPowerMw: "Planned power", plannedMw: "Planned power", utilityCapacityMw: "Utility capacity", gridConnectionMw: "Grid connection", ultimateCampusMw: "Ultimate campus build-out", mwIsEstimate: "MW estimate flag", openedOn: "Opened", announcedOn: "Announced", constructionStartedOn: "Construction started", permitFiledOn: "Permit filed", approvedOn: "Approved", expectedOpening: "Expected opening", investmentUsd: "Investment", address: "Address", postalCode: "Postal code", city: "City", regionName: "Region", countryIso2: "Country", lat: "Latitude", lng: "Longitude", geo: "Coordinates", coordinates: "Coordinates", geoPrecision: "Geo precision", buildingSqm: "Building area", siteAreaHa: "Site area", rackCount: "Racks", pue: "PUE", tier: "Tier", coolingType: "Cooling", renewableClaim: "Renewable claim", certifications: "Certifications", website: "Website", description: "Description", operator: "Operator", operatorName: "Operator", owner: "Owner", ownerName: "Owner", developer: "Developer", landowner: "Landowner", isAi: "AI flag", isHyperscale: "Hyperscale flag", aliases: "Aliases", carriers: "Carriers", cloudProviders: "Cloud providers", ixps: "Internet exchanges", acreage: "Acreage", phaseCount: "Phases", lastVerified: "Last verified", confidence: "Confidence", // claim predicates it_capacity_mw: "IT capacity", critical_power_mw: "Critical power", current_power_mw: "Total power", planned_power_mw: "Planned power", utility_capacity_mw: "Utility capacity", grid_connection_mw: "Grid connection", ultimate_campus_mw: "Ultimate campus build-out", phase_mw: "Phase capacity", project_investment_usd: "Project investment", campus_investment_usd: "Campus investment", company_investment_usd: "Company investment", country_program_usd: "Country programme", multi_year_capex_usd: "Multi-year capex", deal_value_usd: "Deal value", }; export function fieldLabel(field: string): string { if (FIELD_LABEL[field]) return FIELD_LABEL[field]; const camel = field.replace(/_([a-z])/g, (_, c: string) => c.toUpperCase()); if (FIELD_LABEL[camel]) return FIELD_LABEL[camel]; return field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/_/g, " ").replace(/^./, (c) => c.toUpperCase()); } export function valueHint(field: string): "mw" | "date" | "usd" | undefined { if (/Mw$|_mw$/.test(field)) return "mw"; if (/On$|_on$|Opening$|_opening$|Verified$/.test(field)) return "date"; if (/Usd$|_usd$/.test(field)) return "usd"; return undefined; }