refactor: streamline ClientLayout and PreferencesContext for improved state management and debugging

This commit is contained in:
Julien Froidefond
2025-10-24 17:17:35 +02:00
parent 58cabd9cf2
commit 931185f0f0
7 changed files with 63 additions and 33 deletions

View File

@@ -3,7 +3,7 @@
import { CoverClient } from "./cover-client";
import { ProgressBar } from "./progress-bar";
import type { BookCoverProps } from "./cover-utils";
import { getImageUrl } from "./cover-utils";
import { getImageUrl } from "@/lib/utils/image-url";
import { useImageUrl } from "@/hooks/useImageUrl";
import { ClientOfflineBookService } from "@/lib/services/client-offlinebook.service";
import { MarkAsReadButton } from "./mark-as-read-button";

View File

@@ -19,14 +19,3 @@ export interface BookCoverProps extends BaseCoverProps {
export interface SeriesCoverProps extends BaseCoverProps {
series: KomgaSeries;
}
/**
* Génère l'URL de base pour une image (sans cache version)
* Utilisez useImageUrl() dans les composants pour obtenir l'URL avec cache busting
*/
export function getImageUrl(type: "series" | "book", id: string) {
if (type === "series") {
return `/api/komga/images/series/${id}/thumbnail`;
}
return `/api/komga/images/books/${id}/thumbnail`;
}

View File

@@ -3,7 +3,7 @@
import { CoverClient } from "./cover-client";
import { ProgressBar } from "./progress-bar";
import type { SeriesCoverProps } from "./cover-utils";
import { getImageUrl } from "./cover-utils";
import { getImageUrl } from "@/lib/utils/image-url";
import { useImageUrl } from "@/hooks/useImageUrl";
export function SeriesCover({