diff --git a/src/app/doc-truyen/_components/chapter-navigation.tsx b/src/app/doc-truyen/_components/chapter-navigation.tsx index e552eba..3df7ab4 100644 --- a/src/app/doc-truyen/_components/chapter-navigation.tsx +++ b/src/app/doc-truyen/_components/chapter-navigation.tsx @@ -16,10 +16,21 @@ export default function ChapterNavigation({ nextChapterURL, prevChapterURL, }: ChapterNavigationProps) { + const { pluginName: currentPlugin } = usePluginName(); + const searchParams = useSearchParams(); const novelURL = searchParams.get("novelUrl")!; const chapterIndex = Number(searchParams.get("chapterIndex")!); - const { pluginName: currentPlugin } = usePluginName(); + + const buildChapterURL = (chapterIndex: number) => { + const searchParams = new URLSearchParams(); + searchParams.set("novelUrl", novelURL); + searchParams.set("chapterUrl", nextChapterURL!); + searchParams.set("currentPlugin", currentPlugin); + searchParams.set("chapterIndex", chapterIndex.toString()); + + return `/doc-truyen?${searchParams}`; + }; return (