chore: clean up code by removing trailing whitespace and ensuring consistent formatting across various files = prettier
This commit is contained in:
@@ -104,7 +104,11 @@ export function CategoryTrendChart({
|
||||
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"
|
||||
}
|
||||
>
|
||||
{groupByParent ? (
|
||||
<>
|
||||
@@ -173,15 +177,17 @@ export function CategoryTrendChart({
|
||||
content={() => {
|
||||
// Get all category IDs from data
|
||||
const allCategoryIds = Array.from(categoryTotals.keys());
|
||||
|
||||
|
||||
return (
|
||||
<div className="flex flex-wrap justify-center gap-x-4 gap-y-1 mt-2">
|
||||
{allCategoryIds.map((categoryId) => {
|
||||
const categoryInfo = getCategoryInfo(categoryId);
|
||||
const categoryName = getCategoryName(categoryId);
|
||||
if (!categoryInfo && categoryId !== "uncategorized") return null;
|
||||
|
||||
const isInDisplayCategories = displayCategories.includes(categoryId);
|
||||
if (!categoryInfo && categoryId !== "uncategorized")
|
||||
return null;
|
||||
|
||||
const isInDisplayCategories =
|
||||
displayCategories.includes(categoryId);
|
||||
const isSelected =
|
||||
selectedCategories.length === 0
|
||||
? isInDisplayCategories
|
||||
@@ -198,8 +204,8 @@ export function CategoryTrendChart({
|
||||
if (selectedCategories.includes(categoryId)) {
|
||||
setSelectedCategories(
|
||||
selectedCategories.filter(
|
||||
(id) => id !== categoryId
|
||||
)
|
||||
(id) => id !== categoryId,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
setSelectedCategories([
|
||||
@@ -234,8 +240,9 @@ export function CategoryTrendChart({
|
||||
{categoriesToShow.map((categoryId, index) => {
|
||||
const categoryInfo = getCategoryInfo(categoryId);
|
||||
const categoryName = getCategoryName(categoryId);
|
||||
if (!categoryInfo && categoryId !== "uncategorized") return null;
|
||||
|
||||
if (!categoryInfo && categoryId !== "uncategorized")
|
||||
return null;
|
||||
|
||||
const isSelected =
|
||||
selectedCategories.length === 0 ||
|
||||
selectedCategories.includes(categoryId);
|
||||
@@ -245,7 +252,10 @@ export function CategoryTrendChart({
|
||||
type="monotone"
|
||||
dataKey={categoryId}
|
||||
name={categoryName}
|
||||
stroke={categoryInfo?.color || CATEGORY_COLORS[index % CATEGORY_COLORS.length]}
|
||||
stroke={
|
||||
categoryInfo?.color ||
|
||||
CATEGORY_COLORS[index % CATEGORY_COLORS.length]
|
||||
}
|
||||
strokeWidth={isSelected ? 2 : 1}
|
||||
strokeOpacity={isSelected ? 1 : 0.3}
|
||||
dot={false}
|
||||
@@ -265,4 +275,3 @@ export function CategoryTrendChart({
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user