@@ -12,10 +12,14 @@ const colors = { current: "#1b726f", feasible: "#9cc2c1" };
1212const ChartNetIncomePerLandUnit = ( ) => {
1313 const chartFarmEconomicEfficiencyRef = useRef ( null ) ;
1414 const currentCase = CurrentCaseState . useState ( ( s ) => s ) ;
15- const dashboardData = CaseVisualState . useState ( ( s ) => s . dashboardData ) ;
15+ const { dashboardData, questionGroups } = CaseVisualState . useState ( ( s ) => s ) ;
1616
1717 const [ selectedSegment , setSelectedSegment ] = useState ( null ) ;
1818
19+ const focusCommodity = useMemo ( ( ) => {
20+ return questionGroups ?. find ( ( qg ) => qg . case_commodity_type === "focus" ) ;
21+ } , [ questionGroups ] ) ;
22+
1923 const chartData = useMemo ( ( ) => {
2024 const primaryCaseCommodityID = currentCase ?. case_commodities ?. find (
2125 ( cc ) => cc ?. commodity_type === "focus"
@@ -87,7 +91,8 @@ const ChartNetIncomePerLandUnit = () => {
8791 < Col span = { 10 } >
8892 < Space direction = "vertical" >
8993 < div className = "section-title" >
90- Focus crop net income per land unit
94+ Focus crop net income per{ " " }
95+ { focusCommodity ?. area_size_unit || "land unit" }
9196 </ div >
9297 < div className = "section-description" >
9398 This metric captures the net profit earned from the crop per unit
@@ -100,11 +105,6 @@ const ChartNetIncomePerLandUnit = () => {
100105 indicator helps understand whether land productivity is improving
101106 and whether interventions are resulting in better economic
102107 outcomes.
103- < br />
104- < small style = { { color : "#959390" } } >
105- *“land unit” to automatically change to what user selected e.g.
106- hectare/acre etc.
107- </ small >
108108 </ div >
109109 </ Space >
110110 </ Col >
0 commit comments