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.
20 lines
629 B
TypeScript
20 lines
629 B
TypeScript
import type { Widget } from "@/lib/config/schema";
|
|
|
|
type BookmarkWidget = Extract<Widget, { type: "bookmark" }>;
|
|
|
|
export function BookmarkWidget({ widget }: { widget: BookmarkWidget }) {
|
|
return (
|
|
<a
|
|
href={widget.href}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
className="flex flex-col gap-1 rounded-[var(--radius-widget)] border border-border bg-surface p-4 transition-colors hover:border-accent"
|
|
>
|
|
<span className="text-sm font-medium text-fg">{widget.name}</span>
|
|
{widget.description && (
|
|
<span className="text-xs text-fg-muted">{widget.description}</span>
|
|
)}
|
|
</a>
|
|
);
|
|
}
|