chore: clean up code by removing trailing whitespace and ensuring consistent formatting across various files = prettier
This commit is contained in:
@@ -37,13 +37,7 @@ import {
|
||||
AlertDialogTitle,
|
||||
AlertDialogTrigger,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import {
|
||||
Database,
|
||||
Trash2,
|
||||
RotateCcw,
|
||||
Save,
|
||||
Clock,
|
||||
} from "lucide-react";
|
||||
import { Database, Trash2, RotateCcw, Save, Clock } from "lucide-react";
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
import { fr } from "date-fns/locale/fr";
|
||||
import { toast } from "sonner";
|
||||
@@ -84,10 +78,17 @@ export function BackupCard() {
|
||||
|
||||
if (backupsData.success) {
|
||||
setBackups(
|
||||
backupsData.data.map((b: { id: string; filename: string; size: number; createdAt: string }) => ({
|
||||
...b,
|
||||
createdAt: new Date(b.createdAt),
|
||||
}))
|
||||
backupsData.data.map(
|
||||
(b: {
|
||||
id: string;
|
||||
filename: string;
|
||||
size: number;
|
||||
createdAt: string;
|
||||
}) => ({
|
||||
...b,
|
||||
createdAt: new Date(b.createdAt),
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -116,7 +117,9 @@ export function BackupCard() {
|
||||
|
||||
if (data.success) {
|
||||
if (data.data.skipped) {
|
||||
toast.info("Aucun changement détecté. La dernière sauvegarde a été mise à jour.");
|
||||
toast.info(
|
||||
"Aucun changement détecté. La dernière sauvegarde a été mise à jour.",
|
||||
);
|
||||
} else {
|
||||
toast.success("Sauvegarde créée avec succès");
|
||||
}
|
||||
@@ -160,7 +163,9 @@ export function BackupCard() {
|
||||
const data = await response.json();
|
||||
|
||||
if (data.success) {
|
||||
toast.success("Sauvegarde restaurée avec succès. Rechargement de la page...");
|
||||
toast.success(
|
||||
"Sauvegarde restaurée avec succès. Rechargement de la page...",
|
||||
);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 2000);
|
||||
@@ -258,9 +263,9 @@ export function BackupCard() {
|
||||
<Label htmlFor="backup-frequency">Fréquence</Label>
|
||||
<Select
|
||||
value={settings.frequency}
|
||||
onValueChange={(value: "hourly" | "daily" | "weekly" | "monthly") =>
|
||||
handleSettingsChange({ frequency: value })
|
||||
}
|
||||
onValueChange={(
|
||||
value: "hourly" | "daily" | "weekly" | "monthly",
|
||||
) => handleSettingsChange({ frequency: value })}
|
||||
>
|
||||
<SelectTrigger id="backup-frequency">
|
||||
<SelectValue />
|
||||
@@ -369,17 +374,16 @@ export function BackupCard() {
|
||||
Restaurer cette sauvegarde ?
|
||||
</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Cette action va remplacer votre base de données
|
||||
actuelle par cette sauvegarde. Une sauvegarde
|
||||
de sécurité sera créée avant la restauration.
|
||||
Cette action va remplacer votre base de
|
||||
données actuelle par cette sauvegarde. Une
|
||||
sauvegarde de sécurité sera créée avant la
|
||||
restauration.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Annuler</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={() =>
|
||||
handleRestoreBackup(backup.id)
|
||||
}
|
||||
onClick={() => handleRestoreBackup(backup.id)}
|
||||
>
|
||||
Restaurer
|
||||
</AlertDialogAction>
|
||||
@@ -406,9 +410,7 @@ export function BackupCard() {
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Annuler</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={() =>
|
||||
handleDeleteBackup(backup.id)
|
||||
}
|
||||
onClick={() => handleDeleteBackup(backup.id)}
|
||||
>
|
||||
Supprimer
|
||||
</AlertDialogAction>
|
||||
@@ -434,4 +436,3 @@ export function BackupCard() {
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,10 @@ interface DangerZoneCardProps {
|
||||
categorizedCount: number;
|
||||
onClearCategories: () => void;
|
||||
onResetData: () => void;
|
||||
onDeduplicate: () => Promise<{ deletedCount: number; duplicatesFound: number }>;
|
||||
onDeduplicate: () => Promise<{
|
||||
deletedCount: number;
|
||||
duplicatesFound: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
export function DangerZoneCard({
|
||||
@@ -42,7 +45,9 @@ export function DangerZoneCard({
|
||||
try {
|
||||
const result = await onDeduplicate();
|
||||
if (result.deletedCount > 0) {
|
||||
alert(`${result.deletedCount} transaction${result.deletedCount > 1 ? "s" : ""} en double supprimée${result.deletedCount > 1 ? "s" : ""}`);
|
||||
alert(
|
||||
`${result.deletedCount} transaction${result.deletedCount > 1 ? "s" : ""} en double supprimée${result.deletedCount > 1 ? "s" : ""}`,
|
||||
);
|
||||
} else {
|
||||
alert("Aucun doublon trouvé");
|
||||
}
|
||||
@@ -88,10 +93,11 @@ export function DangerZoneCard({
|
||||
Dédoublonner les transactions ?
|
||||
</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Cette action va rechercher et supprimer les transactions en double
|
||||
dans votre base de données. Les critères de dédoublonnage sont :
|
||||
même compte, même date, même montant et même libellé. La première
|
||||
transaction trouvée sera conservée, les autres seront supprimées.
|
||||
Cette action va rechercher et supprimer les transactions en
|
||||
double dans votre base de données. Les critères de dédoublonnage
|
||||
sont : même compte, même date, même montant et même libellé. La
|
||||
première transaction trouvée sera conservée, les autres seront
|
||||
supprimées.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
@@ -131,8 +137,8 @@ export function DangerZoneCard({
|
||||
<AlertDialogDescription>
|
||||
Cette action va retirer la catégorie de {categorizedCount}{" "}
|
||||
opération{categorizedCount > 1 ? "s" : ""}. Les catégories
|
||||
elles-mêmes ne seront pas supprimées, seulement leur
|
||||
affectation aux opérations.
|
||||
elles-mêmes ne seront pas supprimées, seulement leur affectation
|
||||
aux opérations.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
@@ -179,4 +185,3 @@ export function DangerZoneCard({
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,4 +70,3 @@ export function DataCard({
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,3 @@ export { DangerZoneCard } from "./danger-zone-card";
|
||||
export { OFXInfoCard } from "./ofx-info-card";
|
||||
export { BackupCard } from "./backup-card";
|
||||
export { PasswordCard } from "./password-card";
|
||||
|
||||
|
||||
@@ -17,9 +17,7 @@ export function OFXInfoCard() {
|
||||
<FileJson className="w-5 h-5" />
|
||||
Format OFX
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
Informations sur l'import de fichiers
|
||||
</CardDescription>
|
||||
<CardDescription>Informations sur l'import de fichiers</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="prose prose-sm text-muted-foreground">
|
||||
@@ -29,13 +27,12 @@ export function OFXInfoCard() {
|
||||
l'espace client de votre banque.
|
||||
</p>
|
||||
<p className="mt-2">
|
||||
Lors de l'import, les transactions sont automatiquement
|
||||
catégorisées selon les mots-clés définis. Les doublons sont détectés
|
||||
et ignorés automatiquement.
|
||||
Lors de l'import, les transactions sont automatiquement catégorisées
|
||||
selon les mots-clés définis. Les doublons sont détectés et ignorés
|
||||
automatiquement.
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,9 @@ export function PasswordCard() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="confirm-password">Confirmer le mot de passe</Label>
|
||||
<Label htmlFor="confirm-password">
|
||||
Confirmer le mot de passe
|
||||
</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
id="confirm-password"
|
||||
@@ -199,4 +201,3 @@ export function PasswordCard() {
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user