fix: variable name

This commit is contained in:
Sukma Gladys 2024-10-17 09:47:09 +07:00
parent 0ce69f8df4
commit 4f3c42b7d5

View File

@ -54,7 +54,7 @@ export default function AssessmentResultPage() {
];
const chartData = allAspectsData?.aspects.map((aspect, index) => ({
aspectName: aspect.AspectName,
aspectName: aspect.aspectName,
score: Number(formatScore(aspect.averageScore)),
fill: blueColors[index % blueColors.length],
})) || [];
@ -64,14 +64,14 @@ export default function AssessmentResultPage() {
score: Number(formatScore(subAspect.averageScore)),
fill: "#005BFF",
aspectId: subAspect.aspectId,
aspectName: allAspectsData?.aspects.find(aspect => aspect.AspectId === subAspect.aspectId)?.AspectName
aspectName: allAspectsData?.aspects.find(aspect => aspect.aspectId === subAspect.aspectId)?.aspectName
})) || [];
const sortedBarChartData = barChartData.sort((a, b) => (a.aspectId ?? '').localeCompare(b.aspectId ?? ''));
const chartConfig = allAspectsData?.aspects.reduce((config, aspect, index) => {
config[aspect.AspectName.toLowerCase()] = {
label: aspect.AspectName,
config[aspect.aspectName.toLowerCase()] = {
label: aspect.aspectName,
color: blueColors[index % blueColors.length],
};
return config;
@ -96,13 +96,13 @@ export default function AssessmentResultPage() {
<Card className="flex flex-col w-full h-fit my-2 mb-8 border overflow-hidden">
<div className="flex flex-row">
{allAspectsData?.aspects.map((aspect) => (
<div key={aspect.AspectId} className="flex-col bg-white w-full h-full">
<div key={aspect.aspectId} className="flex-col bg-white w-full h-full">
<div className="flex flex-col font-bold items-center justify-center border p-2 h-full w-full">
<p className="text-sm">{aspect.AspectName}</p>
<p className="text-sm">{aspect.aspectName}</p>
<span className="text-2xl">{formatScore(aspect.averageScore)}</span>
</div>
{allSubAspectsData?.subAspects.map((subAspect) => {
if (subAspect.aspectId === aspect.AspectId) {
if (subAspect.aspectId === aspect.aspectId) {
return (
<div key={subAspect.subAspectId} className="flex flex-col gap-2 border-x p-2 h-full w-full">
<div className="flex flex-row gap-2 justify-between h-full w-full">