mirror of
https://github.com/hsjobeki/noogle.git
synced 2024-12-26 15:34:25 +03:00
8679af38a2
* add: deeplinks * add: enhanced pagination for large datasets * add more meta tags * add data to initial state * remove preview page, instead link directly into the list
28 lines
588 B
TypeScript
28 lines
588 B
TypeScript
import { data } from "./data";
|
|
import { MetaData, NixType } from "./nix";
|
|
|
|
export type ComputedState = {
|
|
FOTD: boolean;
|
|
}
|
|
|
|
export type PageState = {
|
|
data: MetaData;
|
|
selected: string | null;
|
|
term: string;
|
|
filter: Filter;
|
|
page: number;
|
|
itemsPerPage: number;
|
|
} & ComputedState;
|
|
|
|
export type InitialPageState = Omit<PageState, keyof ComputedState>;
|
|
|
|
export const initialPageState: InitialPageState = {
|
|
data,
|
|
selected: null,
|
|
term: "",
|
|
filter: { from: "any", to: "any" },
|
|
page: 1,
|
|
itemsPerPage: 10,
|
|
};
|
|
|
|
export type Filter = { to: NixType; from: NixType }; |