UNPKG

@vectara/vectara-ui

Version:

Vectara's design system, codified as a React and Sass component library

13 lines (12 loc) 1.74 kB
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { VuiSpacer } from "../spacer/Spacer"; import { VuiText } from "../typography/Text"; import { VuiChatPanel } from "./ChatPanel"; import { VuiChatSearchResult } from "./ChatSearchResult"; export const VuiChatInspector = ({ turn, onClose }) => { var _a; return (_jsxs(VuiChatPanel, Object.assign({ title: "Chat inspector", onClose: onClose }, { children: [_jsx(VuiText, { children: _jsxs("p", { children: [_jsx("strong", { children: "You asked," }), " \"", turn === null || turn === void 0 ? void 0 : turn.question, "\""] }) }), _jsx(VuiSpacer, { size: "xs" }), _jsx(VuiText, { children: _jsxs("p", { children: [_jsx("strong", { children: "This was interpreted as:" }), " \"", turn === null || turn === void 0 ? void 0 : turn.query, "\""] }) }), _jsx(VuiSpacer, { size: "xs" }), _jsx(VuiText, { children: _jsxs("p", { children: [_jsx("strong", { children: "This was the response:" }), " \"", turn === null || turn === void 0 ? void 0 : turn.answer, "\""] }) }), _jsx(VuiSpacer, { size: "xs" }), _jsx(VuiText, { children: _jsx("p", { children: _jsx("strong", { children: "We created this response based on the preceding conversation and this information:" }) }) }), _jsx(VuiSpacer, { size: "xs" }), (_a = turn === null || turn === void 0 ? void 0 : turn.results) === null || _a === void 0 ? void 0 : _a.map((result, index) => { var _a, _b; return (_jsxs(_Fragment, { children: [_jsx(VuiChatSearchResult, { result: result }), index < ((_b = (_a = turn.results) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) - 1 && _jsx(VuiSpacer, { size: "s" })] })); })] }))); };