@@ -24,10 +24,17 @@ import {
2424import { parseCostDetailsForTable } from "@/containers/projects/custom-project/cost-details/table/utils" ;
2525import { useCustomProjectFilters } from "@/containers/projects/url-store" ;
2626
27- const initialCarbonPriceLabelMap = {
28- [ CUSTOM_PROJECT_PRICE_TYPE . INITIAL_CARBON_PRICE_ASSUMPTION ] :
29- "Initial carbon price" ,
30- [ CUSTOM_PROJECT_PRICE_TYPE . BREAKEVEN_PRICE ] : "OpEx breakeven price" ,
27+ const getInitialCarbonPriceLabel = (
28+ priceType : CUSTOM_PROJECT_PRICE_TYPE ,
29+ carbonRevenuesToCover ?: CARBON_REVENUES_TO_COVER ,
30+ ) : string => {
31+ if ( priceType === CUSTOM_PROJECT_PRICE_TYPE . INITIAL_CARBON_PRICE_ASSUMPTION )
32+ return "Initial carbon price" ;
33+
34+ if ( carbonRevenuesToCover === CARBON_REVENUES_TO_COVER . CAPEX_AND_OPEX )
35+ return "OpEx + CapEx breakeven price" ;
36+
37+ return "OpEx breakeven price" ;
3138} ;
3239const isConservationProjectOutput = (
3340 output : ConservationProjectOutput | RestorationProjectOutput | null ,
@@ -45,6 +52,7 @@ export const useCustomProjectOutput = (
4552 ? "initialCarbonPriceComputationOutput"
4653 : "breakevenPriceComputationOutput" ;
4754 const output = data . output [ key ] ;
55+ const carbonRevenuesToCover = output ?. carbonRevenuesToCover ;
4856
4957 const projectDetailsProps = useMemo ( ( ) => {
5058 return {
@@ -54,9 +62,9 @@ export const useCustomProjectOutput = (
5462 projectLength : data . projectLength ,
5563 ecosystem : data . ecosystem ,
5664 activity : data . activity ,
57- carbonRevenuesToCover : output ?. carbonRevenuesToCover ,
65+ carbonRevenuesToCover,
5866 initialCarbonPrice : {
59- label : initialCarbonPriceLabelMap [ priceType ] ,
67+ label : getInitialCarbonPriceLabel ( priceType , carbonRevenuesToCover ) ,
6068 value : output ?. initialCarbonPrice ,
6169 } ,
6270 lossRate : isConservationProjectOutput ( output , data . activity )
@@ -71,7 +79,7 @@ export const useCustomProjectOutput = (
7179 restorationActivity : data . input ?. parameters ?. restorationActivity ,
7280 } ,
7381 } ;
74- } , [ data , output , priceType ] ) ;
82+ } , [ data , output , priceType , carbonRevenuesToCover ] ) ;
7583
7684 const costDetailsProps = useMemo ( ( ) => {
7785 const costDetails = {
0 commit comments