refactor: standardize quotation marks in pnpm-lock.yaml and improve code formatting across various components; enhance readability and maintain consistency in code style
This commit is contained in:
@@ -42,7 +42,7 @@ export function CategoryBarChart({
|
||||
}) => {
|
||||
const categoryName = payload.value;
|
||||
const item = displayData.find((d) => d.name === categoryName);
|
||||
|
||||
|
||||
if (!item) {
|
||||
return (
|
||||
<text
|
||||
|
||||
@@ -54,7 +54,7 @@ export function MonthlyChart({
|
||||
// Formater les labels de manière plus compacte
|
||||
const formatMonthLabel = (month: string) => {
|
||||
// Format: "janv. 24" -> "janv 24" (enlever le point)
|
||||
return month.replace('.', '');
|
||||
return month.replace(".", "");
|
||||
};
|
||||
|
||||
const chartContent = (
|
||||
@@ -62,10 +62,18 @@ export function MonthlyChart({
|
||||
{data.length > 0 ? (
|
||||
<div className="h-[400px] sm:h-[300px]">
|
||||
<ResponsiveContainer width="100%" height="100%">
|
||||
<LineChart data={data} margin={{ left: 0, right: 10, top: 10, bottom: data.length > 6 ? 80 : 60 }}>
|
||||
<LineChart
|
||||
data={data}
|
||||
margin={{
|
||||
left: 0,
|
||||
right: 10,
|
||||
top: 10,
|
||||
bottom: data.length > 6 ? 80 : 60,
|
||||
}}
|
||||
>
|
||||
<CartesianGrid strokeDasharray="3 3" className="stroke-muted" />
|
||||
<XAxis
|
||||
dataKey="month"
|
||||
<XAxis
|
||||
dataKey="month"
|
||||
className="text-xs"
|
||||
angle={data.length > 6 ? -45 : 0}
|
||||
textAnchor={data.length > 6 ? "end" : "middle"}
|
||||
|
||||
@@ -24,7 +24,10 @@ export function StatsSummaryCards({
|
||||
<Card className="stat-card-textured relative overflow-hidden">
|
||||
{/* Icône en arrière-plan */}
|
||||
<div className="absolute bottom-2 right-2 opacity-[0.04] z-0 pointer-events-none">
|
||||
<TrendingUp className="h-16 w-16 md:h-20 md:w-20 text-success" strokeWidth={1} />
|
||||
<TrendingUp
|
||||
className="h-16 w-16 md:h-20 md:w-20 text-success"
|
||||
strokeWidth={1}
|
||||
/>
|
||||
</div>
|
||||
<CardHeader className="pb-3 px-5 pt-5 relative z-10">
|
||||
<CardTitle className="text-[10px] md:text-xs font-semibold text-muted-foreground/80 uppercase tracking-wider">
|
||||
@@ -41,7 +44,10 @@ export function StatsSummaryCards({
|
||||
<Card className="stat-card-textured relative overflow-hidden">
|
||||
{/* Icône en arrière-plan */}
|
||||
<div className="absolute bottom-2 right-2 opacity-[0.04] z-0 pointer-events-none">
|
||||
<TrendingDown className="h-16 w-16 md:h-20 md:w-20 text-destructive" strokeWidth={1} />
|
||||
<TrendingDown
|
||||
className="h-16 w-16 md:h-20 md:w-20 text-destructive"
|
||||
strokeWidth={1}
|
||||
/>
|
||||
</div>
|
||||
<CardHeader className="pb-3 px-5 pt-5 relative z-10">
|
||||
<CardTitle className="text-[10px] md:text-xs font-semibold text-muted-foreground/80 uppercase tracking-wider">
|
||||
@@ -58,7 +64,10 @@ export function StatsSummaryCards({
|
||||
<Card className="stat-card-textured relative overflow-hidden">
|
||||
{/* Icône en arrière-plan */}
|
||||
<div className="absolute bottom-2 right-2 opacity-[0.04] z-0 pointer-events-none">
|
||||
<ArrowRight className="h-16 w-16 md:h-20 md:w-20 text-muted-foreground/40" strokeWidth={1} />
|
||||
<ArrowRight
|
||||
className="h-16 w-16 md:h-20 md:w-20 text-muted-foreground/40"
|
||||
strokeWidth={1}
|
||||
/>
|
||||
</div>
|
||||
<CardHeader className="pb-3 px-5 pt-5 relative z-10">
|
||||
<CardTitle className="text-[10px] md:text-xs font-semibold text-muted-foreground/80 uppercase tracking-wider">
|
||||
@@ -75,12 +84,12 @@ export function StatsSummaryCards({
|
||||
<Card className="stat-card-textured relative overflow-hidden">
|
||||
{/* Icône en arrière-plan */}
|
||||
<div className="absolute bottom-2 right-2 opacity-[0.04] z-0 pointer-events-none">
|
||||
<div className={cn(
|
||||
"h-16 w-16 md:h-20 md:w-20 rounded-full border-2",
|
||||
savings >= 0
|
||||
? "border-success"
|
||||
: "border-destructive"
|
||||
)} />
|
||||
<div
|
||||
className={cn(
|
||||
"h-16 w-16 md:h-20 md:w-20 rounded-full border-2",
|
||||
savings >= 0 ? "border-success" : "border-destructive",
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<CardHeader className="pb-3 px-5 pt-5 relative z-10">
|
||||
<CardTitle className="text-[10px] md:text-xs font-semibold text-muted-foreground/80 uppercase tracking-wider">
|
||||
|
||||
@@ -4,12 +4,7 @@ import Link from "next/link";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { CategoryIcon } from "@/components/ui/category-icon";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import {
|
||||
Tabs,
|
||||
TabsList,
|
||||
TabsTrigger,
|
||||
TabsContent,
|
||||
} from "@/components/ui/tabs";
|
||||
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
|
||||
import { useIsMobile } from "@/hooks/use-mobile";
|
||||
import type { Transaction, Category } from "@/lib/types";
|
||||
|
||||
@@ -111,40 +106,41 @@ export function TopExpensesList({
|
||||
"fr-FR",
|
||||
)}
|
||||
</span>
|
||||
{expense.categoryId && (() => {
|
||||
const expenseCategory = categories.find(
|
||||
(c) => c.id === expense.categoryId,
|
||||
);
|
||||
// Afficher seulement si c'est une sous-catégorie (a un parentId)
|
||||
if (expenseCategory?.parentId) {
|
||||
return (
|
||||
<Link
|
||||
href={`/transactions?categoryIds=${expenseCategory.id}`}
|
||||
className="inline-block"
|
||||
>
|
||||
<Badge
|
||||
variant="secondary"
|
||||
className="text-[10px] md:text-xs px-1.5 md:px-2 py-0.5 inline-flex items-center gap-1 shrink-0 hover:opacity-80 transition-opacity cursor-pointer"
|
||||
style={{
|
||||
backgroundColor: `${expenseCategory.color}20`,
|
||||
color: expenseCategory.color,
|
||||
borderColor: `${expenseCategory.color}30`,
|
||||
}}
|
||||
>
|
||||
<CategoryIcon
|
||||
icon={expenseCategory.icon}
|
||||
color={expenseCategory.color}
|
||||
size={isMobile ? 8 : 10}
|
||||
/>
|
||||
<span className="truncate max-w-[100px] md:max-w-none">
|
||||
{expenseCategory.name}
|
||||
</span>
|
||||
</Badge>
|
||||
</Link>
|
||||
{expense.categoryId &&
|
||||
(() => {
|
||||
const expenseCategory = categories.find(
|
||||
(c) => c.id === expense.categoryId,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
})()}
|
||||
// Afficher seulement si c'est une sous-catégorie (a un parentId)
|
||||
if (expenseCategory?.parentId) {
|
||||
return (
|
||||
<Link
|
||||
href={`/transactions?categoryIds=${expenseCategory.id}`}
|
||||
className="inline-block"
|
||||
>
|
||||
<Badge
|
||||
variant="secondary"
|
||||
className="text-[10px] md:text-xs px-1.5 md:px-2 py-0.5 inline-flex items-center gap-1 shrink-0 hover:opacity-80 transition-opacity cursor-pointer"
|
||||
style={{
|
||||
backgroundColor: `${expenseCategory.color}20`,
|
||||
color: expenseCategory.color,
|
||||
borderColor: `${expenseCategory.color}30`,
|
||||
}}
|
||||
>
|
||||
<CategoryIcon
|
||||
icon={expenseCategory.icon}
|
||||
color={expenseCategory.color}
|
||||
size={isMobile ? 8 : 10}
|
||||
/>
|
||||
<span className="truncate max-w-[100px] md:max-w-none">
|
||||
{expenseCategory.name}
|
||||
</span>
|
||||
</Badge>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
})()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user