Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions packages/chat-ui/src/blocks/block-card.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Presentational primitives shared by every block view: the card frame with
// its pulse-dot header and the risk badge. Kept free of chat state and chat
// strings so they can lift into @corbits/react-ui unchanged.
// Presentational primitive shared by every block view: the card frame with
// its pulse-dot header. Kept free of chat state and chat strings so it can
// lift into @corbits/react-ui unchanged.

import { Warning } from "@corbits/icons";
import type { ReactNode } from "react";

export function BlockCard({
Expand All @@ -22,23 +21,3 @@ export function BlockCard({
</div>
);
}

export function RiskBadge({
level,
label,
note,
}: {
readonly level: "low" | "medium" | "high";
readonly label: string;
readonly note?: string | undefined;
}) {
return (
<span className="chat-block-risk" data-risk={level}>
<Warning aria-hidden="true" />
<span>{label}</span>
{note !== undefined && (
<span className="chat-block-risk-note">{note}</span>
)}
</span>
);
}
3 changes: 2 additions & 1 deletion packages/chat-ui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ export { CHAT_STRINGS } from "./strings";
export { displayWorkbenchTitle } from "./workbench-display-title";

export { BlockPartView } from "./blocks/registry";
export { BlockCard, RiskBadge } from "./blocks/block-card";
export { BlockCard } from "./blocks/block-card";
export { ConnectGithubBlockView } from "./blocks/connect-github-block";

export type {
ConnectGithubCardProps,
ConnectGithubRepo,
Expand Down
Loading