chore: clean up code by removing trailing whitespace and ensuring consistent formatting across various files = prettier
This commit is contained in:
@@ -4,13 +4,7 @@ import { useState } from "react";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { CategoryIcon } from "@/components/ui/category-icon";
|
||||
import {
|
||||
PieChart,
|
||||
Pie,
|
||||
Cell,
|
||||
Tooltip,
|
||||
ResponsiveContainer,
|
||||
} from "recharts";
|
||||
import { PieChart, Pie, Cell, Tooltip, ResponsiveContainer } from "recharts";
|
||||
import { Layers, List, ChevronDown, ChevronUp } from "lucide-react";
|
||||
import type { Category } from "@/lib/types";
|
||||
|
||||
@@ -48,8 +42,8 @@ export function CategoryPieChart({
|
||||
const [groupByParent, setGroupByParent] = useState(true);
|
||||
const [isExpanded, setIsExpanded] = useState(false);
|
||||
const hasParentData = dataByParent && dataByParent.length > 0;
|
||||
const baseData = (groupByParent && hasParentData) ? dataByParent : data;
|
||||
|
||||
const baseData = groupByParent && hasParentData ? dataByParent : data;
|
||||
|
||||
// Limit to top 8 by default, show all if expanded
|
||||
const maxItems = 8;
|
||||
const currentData = isExpanded ? baseData : baseData.slice(0, maxItems);
|
||||
@@ -64,7 +58,11 @@ export function CategoryPieChart({
|
||||
variant={groupByParent ? "default" : "ghost"}
|
||||
size="sm"
|
||||
onClick={() => setGroupByParent(!groupByParent)}
|
||||
title={groupByParent ? "Afficher toutes les catégories" : "Regrouper par catégories parentes"}
|
||||
title={
|
||||
groupByParent
|
||||
? "Afficher toutes les catégories"
|
||||
: "Regrouper par catégories parentes"
|
||||
}
|
||||
className="w-full md:w-auto text-xs md:text-sm"
|
||||
>
|
||||
{groupByParent ? (
|
||||
@@ -197,4 +195,3 @@ export function CategoryPieChart({
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user