refactor: clean up imports and enhance type definitions across multiple components for improved clarity and maintainability
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
|||||||
normalizeDescription,
|
normalizeDescription,
|
||||||
suggestKeyword,
|
suggestKeyword,
|
||||||
} from "@/components/rules/constants";
|
} from "@/components/rules/constants";
|
||||||
import type { Transaction, Category } from "@/lib/types";
|
import type { Transaction } from "@/lib/types";
|
||||||
|
|
||||||
interface TransactionGroup {
|
interface TransactionGroup {
|
||||||
key: string;
|
key: string;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export default function SettingsPage() {
|
|||||||
|
|
||||||
update(importedData);
|
update(importedData);
|
||||||
alert("Données importées avec succès");
|
alert("Données importées avec succès");
|
||||||
} catch (error) {
|
} catch {
|
||||||
alert("Erreur lors de l'import");
|
alert("Erreur lors de l'import");
|
||||||
} finally {
|
} finally {
|
||||||
setImporting(false);
|
setImporting(false);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { ReactNode } from "react";
|
|||||||
|
|
||||||
interface PageHeaderProps {
|
interface PageHeaderProps {
|
||||||
title: string;
|
title: string;
|
||||||
description?: string;
|
description?: string | ReactNode;
|
||||||
actions?: ReactNode;
|
actions?: ReactNode;
|
||||||
rightContent?: ReactNode;
|
rightContent?: ReactNode;
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ export function PageHeader({
|
|||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-foreground">{title}</h1>
|
<h1 className="text-2xl font-bold text-foreground">{title}</h1>
|
||||||
{description && (
|
{description && (
|
||||||
<p className="text-muted-foreground">{description}</p>
|
<div className="text-muted-foreground">{description}</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{rightContent}
|
{rightContent}
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ export function TransactionTable({
|
|||||||
accounts,
|
accounts,
|
||||||
categories,
|
categories,
|
||||||
selectedTransactions,
|
selectedTransactions,
|
||||||
sortField,
|
sortField: _sortField,
|
||||||
sortOrder,
|
sortOrder: _sortOrder,
|
||||||
onSortChange,
|
onSortChange,
|
||||||
onToggleSelectAll,
|
onToggleSelectAll,
|
||||||
onToggleSelectTransaction,
|
onToggleSelectTransaction,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import { useState, useMemo } from "react";
|
import { useState, useMemo } from "react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Badge } from "@/components/ui/badge";
|
|
||||||
import {
|
import {
|
||||||
Command,
|
Command,
|
||||||
CommandEmpty,
|
CommandEmpty,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type ToasterToast = ToastProps & {
|
|||||||
action?: ToastActionElement;
|
action?: ToastActionElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
const actionTypes = {
|
const _actionTypes = {
|
||||||
ADD_TOAST: "ADD_TOAST",
|
ADD_TOAST: "ADD_TOAST",
|
||||||
UPDATE_TOAST: "UPDATE_TOAST",
|
UPDATE_TOAST: "UPDATE_TOAST",
|
||||||
DISMISS_TOAST: "DISMISS_TOAST",
|
DISMISS_TOAST: "DISMISS_TOAST",
|
||||||
@@ -29,7 +29,7 @@ function genId() {
|
|||||||
return count.toString();
|
return count.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
type ActionType = typeof actionTypes;
|
type ActionType = typeof _actionTypes;
|
||||||
|
|
||||||
type Action =
|
type Action =
|
||||||
| {
|
| {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type ToasterToast = ToastProps & {
|
|||||||
action?: ToastActionElement;
|
action?: ToastActionElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
const actionTypes = {
|
const _actionTypes = {
|
||||||
ADD_TOAST: "ADD_TOAST",
|
ADD_TOAST: "ADD_TOAST",
|
||||||
UPDATE_TOAST: "UPDATE_TOAST",
|
UPDATE_TOAST: "UPDATE_TOAST",
|
||||||
DISMISS_TOAST: "DISMISS_TOAST",
|
DISMISS_TOAST: "DISMISS_TOAST",
|
||||||
@@ -29,7 +29,7 @@ function genId() {
|
|||||||
return count.toString();
|
return count.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
type ActionType = typeof actionTypes;
|
type ActionType = typeof _actionTypes;
|
||||||
|
|
||||||
type Action =
|
type Action =
|
||||||
| {
|
| {
|
||||||
|
|||||||
Reference in New Issue
Block a user