mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
p2 (Pi Mobile on Chord v2) moves from pi-private into pi as one commit. Root scripts that loop all workspaces use --if-present; npm test, ./test.sh and the release script cover packages/* only (p2: cd apps/p2 && npm test); sync-versions also updates apps' workspace pins.
15 lines
787 B
TypeScript
15 lines
787 B
TypeScript
// A transcript as the chat shows it, for browser-only component fixtures: a scroller with the virtual list's rows.
|
|
import { createElement, useMemo } from "react";
|
|
import { Messages, rowEstimates, transcriptRows } from "../../src/web/Chat.tsx";
|
|
import type { Transcript } from "../../src/web/transcript.ts";
|
|
import { useChatScroll } from "../../src/web/use-chat-scroll.ts";
|
|
|
|
export function TranscriptFixture({ transcript }: { transcript: Transcript }) {
|
|
const rows = useMemo(() => transcriptRows(transcript.items), [transcript]);
|
|
const follow = useChatScroll({ rows, estimates: rowEstimates });
|
|
return createElement(
|
|
"div",
|
|
{ className: "scroller transcript", ref: follow.scroller },
|
|
createElement(Messages, { transcript, rows, list: follow.list, range: follow.range }),
|
|
);
|
|
}
|