diff --git a/apps/client/src/widgets/collections/NoteList.tsx b/apps/client/src/widgets/collections/NoteList.tsx index bd007a40f..1f6427978 100644 --- a/apps/client/src/widgets/collections/NoteList.tsx +++ b/apps/client/src/widgets/collections/NoteList.tsx @@ -2,20 +2,12 @@ import { allViewTypes, ViewModeMedia, ViewModeProps, ViewTypeOptions } from "./i import { useNoteContext, useNoteLabel, useNoteLabelBoolean, useTriliumEvent } from "../react/hooks"; import FNote from "../../entities/fnote"; import "./NoteList.css"; -import { ListView, GridView } from "./legacy/ListOrGridView"; import { useEffect, useRef, useState } from "preact/hooks"; -import GeoView from "./geomap"; import ViewModeStorage from "./view_mode_storage"; -import CalendarView from "./calendar"; -import TableView from "./table"; -import BoardView from "./board"; import { subscribeToMessages, unsubscribeToMessage as unsubscribeFromMessage } from "../../services/ws"; import { WebSocketMessage } from "@triliumnext/commons"; import froca from "../../services/froca"; -import PresentationView from "./presentation"; -import { ListPrintView } from "./legacy/ListPrintView"; -import TablePrintView from "./table/TablePrintView"; - +import { lazy, Suspense } from "preact/compat"; interface NoteListProps { note: FNote | null | undefined; notePath: string | null | undefined; @@ -94,11 +86,15 @@ export function CustomNoteList({ note, viewType, isEnabled: shouldEnable, notePa } } + const ComponentToRender = viewType && props && isEnabled && getComponentByViewType(viewType, props); + return (