UNPKG

@dugongjs/cli

Version:

19 lines (18 loc) 1.32 kB
import { Box, Text } from "ink"; import React from "react"; import { JSONViewer } from "../components/json-viewer.js"; import { Pane } from "../components/pane.js"; import { ValueDisplay } from "../components/value-display.js"; export const AggregateViewPane = (props) => { const { isLoading, aggregateType, aggregateId, aggregate, isDeleted } = props; return (React.createElement(Pane, { isLoading: isLoading }, React.createElement(Text, { bold: true }, "Aggregate"), !aggregate ? (React.createElement(Text, { color: "gray" }, "No aggregate selected")) : (React.createElement(Box, { flexDirection: "column", width: "100%", height: "100%" }, React.createElement(Box, { flexDirection: "column", width: "100%", padding: 1 }, React.createElement(ValueDisplay, { label: "Type", value: aggregateType ?? "none" }), React.createElement(ValueDisplay, { label: "ID", value: aggregateId ?? "none" }), React.createElement(ValueDisplay, { label: "Is deleted", value: isDeleted ? "Yes" : "No" })), React.createElement(Box, { flexDirection: "column", rowGap: 1, width: "100%", padding: 1 }, React.createElement(Text, { bold: true }, "State"), React.createElement(JSONViewer, { data: aggregate })))))); };