refactor(react/collections): reintroduce view mode

This commit is contained in:
Elian Doran
2025-09-03 23:57:38 +03:00
parent 330b17bff8
commit 620e6012da
5 changed files with 26 additions and 25 deletions

View File

@@ -1,15 +1,17 @@
import FNote from "../../entities/fnote";
import type { ViewModeArgs } from "../view_widgets/view_mode";
import ViewModeStorage from "../view_widgets/view_mode_storage";
export const allViewTypes = ["list", "grid", "calendar", "table", "geoMap", "board"] as const;
export type ArgsWithoutNoteId = Omit<ViewModeArgs, "noteIds">;
export type ViewTypeOptions = typeof allViewTypes[number];
export interface ViewModeProps {
export interface ViewModeProps<T extends object> {
note: FNote;
/**
* We're using noteIds so that it's not necessary to load all notes at once when paging.
*/
noteIds: string[];
highlightedTokens: string[] | null | undefined;
viewStorage: ViewModeStorage<T>;
}