Skip to content

Commit

Permalink
Refactor component name to match chart type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ru Chern Chong committed Dec 31, 2023
1 parent 325269d commit 4274eb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { CarHeatmap } from "@/components/CarHeatmap";
import { CarTreemap } from "@/components/CarTreemap";
import { Infographic } from "@/components/Infographic";
import {
API_URL,
Expand Down Expand Up @@ -54,7 +54,7 @@ const Home = async () => {
electricCars={filteredElectricCars}
isPopularMake={popularMakes}
/>
<CarHeatmap data={filteredElectricCars} popularMakes={popularMakes} />
<CarTreemap data={filteredElectricCars} popularMakes={popularMakes} />
</div>
</section>
);
Expand Down
4 changes: 2 additions & 2 deletions components/CarHeatmap.tsx → components/CarTreemap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import { Car } from "@/types";

const ApexChart = dynamic(() => import("react-apexcharts"), { ssr: false });

interface CarHeatmapProps {
interface CarTreemapProps {
data: Car[];
popularMakes: any;
}

export const CarHeatmap = ({ data, popularMakes }: CarHeatmapProps) => {
export const CarTreemap = ({ data, popularMakes }: CarTreemapProps) => {
const months = [...new Set(data.map(({ month }) => month))];
const sortedMonth = months.map((month) => parseISO(month)).sort(compareAsc);
const latestMonth = format(sortedMonth[sortedMonth.length - 1], "yyyy-MM");
Expand Down

0 comments on commit 4274eb0

Please sign in to comment.