import { useContext, useMemo } from "preact/hooks"; import { LaunchBarContext, LaunchBarDropdownButton, useLauncherIconAndTitle } from "./launch_bar_widgets"; import { CSSProperties } from "preact"; import type FNote from "../../entities/fnote"; import { useChildNotes, useNoteLabelBoolean } from "../react/hooks"; import "./BookmarkButtons.css"; import NoteLink from "../react/NoteLink"; import { CustomNoteLauncher } from "./GenericButtons"; const PARENT_NOTE_ID = "_lbBookmarks"; export default function BookmarkButtons() { const { isHorizontalLayout } = useContext(LaunchBarContext); const style = useMemo(() => ({ display: "flex", flexDirection: isHorizontalLayout ? "row" : "column", contain: "none" }), [ isHorizontalLayout ]); const childNotes = useChildNotes(PARENT_NOTE_ID); return (
{childNotes?.map(childNote => )}
) } function SingleBookmark({ note }: { note: FNote }) { const [ bookmarkFolder ] = useNoteLabelBoolean(note, "bookmarkFolder"); return bookmarkFolder ? : note.noteId} /> } function BookmarkFolder({ note }: { note: FNote }) { const { icon, title } = useLauncherIconAndTitle(note); const childNotes = useChildNotes(note.noteId); return (
    {childNotes.map(childNote => (
  • ))}
) }