"use client"; import { useEditor } from "@/hooks/use-editor"; import { findCurrentScene } from "@/lib/scenes"; import { getBookmarksActiveAtTime } from "@/lib/timeline/bookmarks"; export function BookmarkNoteOverlay() { const editor = useEditor(); const currentTime = editor.playback.getCurrentTime(); const activeProject = editor.project.getActive(); if (!activeProject) { return null; } const activeScene = findCurrentScene({ scenes: activeProject.scenes, currentSceneId: activeProject.currentSceneId, }); if (!activeScene) { return null; } const bookmarks = activeScene.bookmarks; const activeBookmarks = getBookmarksActiveAtTime({ bookmarks, time: currentTime, }); const bookmarksWithNotes = activeBookmarks.filter( (bookmark) => bookmark.note != null && bookmark.note.trim() !== "", ); if (bookmarksWithNotes.length === 0) { return null; } return (
{bookmarksWithNotes.map((bookmark) => (
{bookmark.note}
))}
); }