From c082ab5e63192a84b5d2f121678f3cd96a26a26c Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Sat, 29 Nov 2025 18:03:19 +0100 Subject: [PATCH] refactor: clean up imports and enhance type definitions across multiple components for improved clarity and maintainability --- app/rules/page.tsx | 2 +- app/settings/page.tsx | 2 +- components/layout/page-header.tsx | 4 ++-- components/transactions/transaction-table.tsx | 4 ++-- components/ui/category-filter-combobox.tsx | 1 - components/ui/use-toast.ts | 4 ++-- hooks/use-toast.ts | 4 ++-- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/rules/page.tsx b/app/rules/page.tsx index e7e2324..fc14d76 100644 --- a/app/rules/page.tsx +++ b/app/rules/page.tsx @@ -16,7 +16,7 @@ import { normalizeDescription, suggestKeyword, } from "@/components/rules/constants"; -import type { Transaction, Category } from "@/lib/types"; +import type { Transaction } from "@/lib/types"; interface TransactionGroup { key: string; diff --git a/app/settings/page.tsx b/app/settings/page.tsx index fc81269..d054943 100644 --- a/app/settings/page.tsx +++ b/app/settings/page.tsx @@ -52,7 +52,7 @@ export default function SettingsPage() { update(importedData); alert("Données importées avec succès"); - } catch (error) { + } catch { alert("Erreur lors de l'import"); } finally { setImporting(false); diff --git a/components/layout/page-header.tsx b/components/layout/page-header.tsx index 98f80f6..2a3033e 100644 --- a/components/layout/page-header.tsx +++ b/components/layout/page-header.tsx @@ -4,7 +4,7 @@ import { ReactNode } from "react"; interface PageHeaderProps { title: string; - description?: string; + description?: string | ReactNode; actions?: ReactNode; rightContent?: ReactNode; } @@ -20,7 +20,7 @@ export function PageHeader({

{title}

{description && ( -

{description}

+
{description}
)}
{rightContent} diff --git a/components/transactions/transaction-table.tsx b/components/transactions/transaction-table.tsx index 5487e31..bc99442 100644 --- a/components/transactions/transaction-table.tsx +++ b/components/transactions/transaction-table.tsx @@ -48,8 +48,8 @@ export function TransactionTable({ accounts, categories, selectedTransactions, - sortField, - sortOrder, + sortField: _sortField, + sortOrder: _sortOrder, onSortChange, onToggleSelectAll, onToggleSelectTransaction, diff --git a/components/ui/category-filter-combobox.tsx b/components/ui/category-filter-combobox.tsx index dc6f156..78026fe 100644 --- a/components/ui/category-filter-combobox.tsx +++ b/components/ui/category-filter-combobox.tsx @@ -2,7 +2,6 @@ import { useState, useMemo } from "react"; import { Button } from "@/components/ui/button"; -import { Badge } from "@/components/ui/badge"; import { Command, CommandEmpty, diff --git a/components/ui/use-toast.ts b/components/ui/use-toast.ts index 6555e79..276fe29 100644 --- a/components/ui/use-toast.ts +++ b/components/ui/use-toast.ts @@ -15,7 +15,7 @@ type ToasterToast = ToastProps & { action?: ToastActionElement; }; -const actionTypes = { +const _actionTypes = { ADD_TOAST: "ADD_TOAST", UPDATE_TOAST: "UPDATE_TOAST", DISMISS_TOAST: "DISMISS_TOAST", @@ -29,7 +29,7 @@ function genId() { return count.toString(); } -type ActionType = typeof actionTypes; +type ActionType = typeof _actionTypes; type Action = | { diff --git a/hooks/use-toast.ts b/hooks/use-toast.ts index 6555e79..276fe29 100644 --- a/hooks/use-toast.ts +++ b/hooks/use-toast.ts @@ -15,7 +15,7 @@ type ToasterToast = ToastProps & { action?: ToastActionElement; }; -const actionTypes = { +const _actionTypes = { ADD_TOAST: "ADD_TOAST", UPDATE_TOAST: "UPDATE_TOAST", DISMISS_TOAST: "DISMISS_TOAST", @@ -29,7 +29,7 @@ function genId() { return count.toString(); } -type ActionType = typeof actionTypes; +type ActionType = typeof _actionTypes; type Action = | {