Fork Horse repository, listed by its owner. Publisher snapshot.

packages/forkhorse-dashboard/src/render.ts

Snapshot at 34e3175

Containing directory

625 bytes · typescriptView raw
1import { createElement } from "react";
2import { renderToStaticMarkup } from "react-dom/server";
3import { DashboardView } from "./view.tsx";
4import type { ViewModel } from "./model.ts";
5
6/** Static test projection uses the same real components as the browser. React escapes all text. */
7export function renderDashboard(view: ViewModel): string {
8  return renderToStaticMarkup(
9    createElement(DashboardView, {
10      view,
11      actions: {
12        section: "overview",
13        owner: true,
14        async selectProject() {},
15        setSection() {},
16        openReview() {},
17        async action() {},
18      },
19    }),
20  );
21}
22