chore: clean up code by removing trailing whitespace and ensuring consistent formatting across various files = prettier

This commit is contained in:
Julien Froidefond
2025-12-01 08:37:30 +01:00
parent 757b1b84ab
commit e715779de7
98 changed files with 5453 additions and 3126 deletions

View File

@@ -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>
);
}