feat(i18n): first shoot on translated errors
This commit is contained in:
@@ -8,6 +8,8 @@ import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
import { LibraryResponse } from "@/types/library";
|
||||
import { KomgaSeries, KomgaLibrary } from "@/types/komga";
|
||||
import { UserPreferences } from "@/types/preferences";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
|
||||
interface PageProps {
|
||||
params: { libraryId: string };
|
||||
searchParams: { page?: string; unread?: string; search?: string };
|
||||
@@ -90,17 +92,20 @@ async function LibraryPage({ params, searchParams }: PageProps) {
|
||||
</div>
|
||||
);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
return (
|
||||
<div className="container py-8 space-y-8">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-3xl font-bold">Séries</h1>
|
||||
<RefreshButton libraryId={params.libraryId} refreshLibrary={refreshLibrary} />
|
||||
</div>
|
||||
<ErrorMessage errorCode="SERIES_FETCH_ERROR" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="container py-8 space-y-8">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-3xl font-bold">Séries</h1>
|
||||
<RefreshButton libraryId={params.libraryId} refreshLibrary={refreshLibrary} />
|
||||
</div>
|
||||
<ErrorMessage
|
||||
message={
|
||||
error instanceof Error ? error.message : "Erreur lors de la récupération des séries"
|
||||
}
|
||||
/>
|
||||
<ErrorMessage errorCode="SERIES_FETCH_ERROR" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user