diff --git a/src/app/api/portfolio/scenario/[scenarioId]/route.ts b/src/app/api/portfolio/scenario/[scenarioId]/route.ts index 32de0ba..4bca34c 100644 --- a/src/app/api/portfolio/scenario/[scenarioId]/route.ts +++ b/src/app/api/portfolio/scenario/[scenarioId]/route.ts @@ -74,7 +74,7 @@ export async function GET( ], }, { - title: "Co2/unit", + title: "CO2/unit", scenarios: [ { scenarioName: scenarioName, diff --git a/src/app/components/portfolio/summary/SummaryTable.tsx b/src/app/components/portfolio/summary/SummaryTable.tsx index ada61aa..f0bac3d 100644 --- a/src/app/components/portfolio/summary/SummaryTable.tsx +++ b/src/app/components/portfolio/summary/SummaryTable.tsx @@ -18,7 +18,7 @@ import { import SelectComparisonModal from "./SelectComparisonModal"; import EpcBarChart from "./EpcBarChart"; import { DataItem, ChartData } from "@/app/portfolio/[slug]/utils"; -import { QueryKey, UseQueryOptions, useQuery } from "@tanstack/react-query"; +import { UseQueryOptions, useQuery } from "@tanstack/react-query"; export async function getComparsionOverviewScenarioData( scenarioId: string @@ -64,6 +64,18 @@ const shouldHighlightRow = (title: string) => { ].includes(title); }; +const formatCo2Title = (content: any) => { + if (content === "CO2/unit") { + return "CO₂/unit"; + } + + if (content === "£ per CO2 reduction") { + return "£ per CO₂ reduction"; + } + + return content; +}; + const SummaryTable = ({ data, scenarios, @@ -215,7 +227,10 @@ const SummaryTable = ({ > {row.getVisibleCells().map((cell) => ( - {flexRender(cell.column.columnDef.cell, cell.getContext())} + {flexRender(cell.column.columnDef.cell, { + ...cell.getContext(), + getValue: () => formatCo2Title(cell.getValue()), + })} ))} diff --git a/src/app/portfolio/[slug]/utils.ts b/src/app/portfolio/[slug]/utils.ts index 1f9e8d1..f8be3b2 100644 --- a/src/app/portfolio/[slug]/utils.ts +++ b/src/app/portfolio/[slug]/utils.ts @@ -186,7 +186,7 @@ export async function getOverviewPortfolioData( ], }, { - title: "Co2/unit", + title: "CO2/unit", scenarios: [ { scenarioName: "Today", data: data[0].co2PerUnitPreRetrofit || "" }, {