Add coverImage poster to player, fix TipTap v3 editor reset, quiz admin preview

- Add coverImage field to Lesson model (prisma)
- Pass coverImage as poster prop to KinescopePlayer
- Show quiz in read-only preview mode for admin on lesson page
- Fix TipTap v3 editor reset on save: pass [lesson.id] as deps to useEditor
  to prevent setOptions() from reinitializing content on every re-render
- Replace saveLesson Server Action call with fetch PATCH /api/admin/lessons/[id]
  to avoid Next.js 16 automatic RSC refresh after Server Actions
- Simplify revalidatePath: only revalidate module page, not lesson editor page
This commit is contained in:
2026-05-01 13:26:30 +00:00
parent c25369b766
commit 7888a7598b
6 changed files with 111 additions and 33 deletions
+3 -1
View File
@@ -4,15 +4,17 @@ import KinescopeReactPlayer from "@kinescope/react-kinescope-player";
interface Props {
videoId: string;
poster?: string;
}
export function KinescopePlayer({ videoId }: Props) {
export function KinescopePlayer({ videoId, poster }: Props) {
return (
<div className="w-full aspect-video" style={{ border: "2px solid var(--border)" }}>
<KinescopeReactPlayer
videoId={videoId}
width="100%"
height="100%"
poster={poster}
/>
</div>
);