-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
solutions report: moves blm calibrations to another page
- Loading branch information
1 parent
8a6cbb4
commit 3273f80
Showing
3 changed files
with
59 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
app/layout/scenarios/reports/solutions/calibration-results/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import Image from 'next/image'; | ||
import { useRouter } from 'next/router'; | ||
|
||
import { useScenarioCalibrationResults } from 'hooks/scenarios'; | ||
|
||
import BlmChart from 'layout/project/sidebar/scenario/advanced-settings/blm-calibration/chart'; | ||
|
||
const CalibrationResultsReport = (): JSX.Element => { | ||
const { query } = useRouter(); | ||
const { sid } = query as { sid: string }; | ||
|
||
const calibrationResultsQuery = useScenarioCalibrationResults(sid); | ||
|
||
const chartData = [...calibrationResultsQuery.data].sort((a, b) => a.cost - b.cost); | ||
|
||
return ( | ||
<div className="space-y-8"> | ||
<div className="grid grid-cols-2 flex-col gap-3"> | ||
{calibrationResultsQuery.data?.map((cr) => { | ||
return ( | ||
<div key={`${cr.scenarioId}-${cr.blmValue}`} className="flex space-x-3 bg-gray-600"> | ||
{cr.pngData && <Image src={cr.pngData} alt="Blm Image" width={150} height={150} />} | ||
<div className="flex flex-col space-y-2 py-2 text-sm"> | ||
<div> | ||
<p className="font-medium uppercase text-white">BLM:</p> | ||
<p className="text-primary-500">{cr.blmValue}</p> | ||
</div> | ||
<div> | ||
<p className="font-medium uppercase text-white">COST:</p> | ||
<p className="text-primary-500">{cr.cost}</p> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
{chartData?.length > 0 && ( | ||
<div className="h-72 w-full space-y-4 bg-gray-600 p-4"> | ||
<h3 className="text-sm font-bold text-white">Calibration results</h3> | ||
<BlmChart data={chartData} selected={null} onChange={() => {}} /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default CalibrationResultsReport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters