Files
reader/app/truyen/[slug]/[chapterId]/chapter-reader-progress.tsx
T
2026-03-05 16:46:38 +07:00

25 lines
612 B
TypeScript

"use client"
import { useEffect } from "react"
import { useAuth } from "@/lib/auth-context"
import { useBookmarks } from "@/lib/bookmark-context"
interface ChapterReaderProgressProps {
novelId: string
chapterId: string
chapterNumber: number
}
export function ChapterReaderProgress({ novelId, chapterId, chapterNumber }: ChapterReaderProgressProps) {
const { user } = useAuth()
const { updateProgress } = useBookmarks()
useEffect(() => {
if (user) {
updateProgress(novelId, chapterId, chapterNumber)
}
}, [user, novelId, chapterId, chapterNumber, updateProgress])
return null
}