feat: enhance home and library pages by integrating new data fetching methods, improving error handling, and refactoring components for better structure
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 4m17s

This commit is contained in:
Julien Froidefond
2026-01-04 06:19:45 +01:00
parent 489e570348
commit b497746cfa
19 changed files with 598 additions and 834 deletions

View File

@@ -0,0 +1,31 @@
"use client";
import { createContext, useContext, type ReactNode } from "react";
interface RefreshContextType {
refreshLibrary?: (libraryId: string) => Promise<{ success: boolean; error?: string }>;
refreshSeries?: (seriesId: string) => Promise<{ success: boolean; error?: string }>;
}
const RefreshContext = createContext<RefreshContextType>({});
export function RefreshProvider({
children,
refreshLibrary,
refreshSeries,
}: {
children: ReactNode;
refreshLibrary?: (libraryId: string) => Promise<{ success: boolean; error?: string }>;
refreshSeries?: (seriesId: string) => Promise<{ success: boolean; error?: string }>;
}) {
return (
<RefreshContext.Provider value={{ refreshLibrary, refreshSeries }}>
{children}
</RefreshContext.Provider>
);
}
export function useRefresh() {
return useContext(RefreshContext);
}