Next.js 16 + TypeScript + Tailwind v4 app with a YAML-driven config system: schema validation (zod), .env interpolation, and a widget registry rendering bookmark/search/group widgets. CSS custom properties (--pn-*) drive theming and are overridable from config.yml's theme.variables. Config load errors surface as a readable error page instead of crashing the app. Hot reload, docker/system/http collectors, and the WebSocket push layer land in later milestones per the approved plan.
14 lines
440 B
TypeScript
14 lines
440 B
TypeScript
import type { ComponentType } from "react";
|
|
import type { Widget } from "@/lib/config/schema";
|
|
import { BookmarkWidget } from "./bookmark/Widget";
|
|
import { SearchWidget } from "./search/Widget";
|
|
|
|
type WidgetComponent<T extends Widget["type"]> = ComponentType<{
|
|
widget: Extract<Widget, { type: T }>;
|
|
}>;
|
|
|
|
export const widgetRegistry: { [K in Widget["type"]]: WidgetComponent<K> } = {
|
|
bookmark: BookmarkWidget,
|
|
search: SearchWidget,
|
|
};
|