UNPKG

@dugongjs/cli

Version:

16 lines (15 loc) 984 B
import { Box, Spacer, Text } from "ink"; import SelectInput from "ink-select-input"; import React from "react"; import { Pane } from "../components/pane.js"; export const AggregateTypeSelectPane = (props) => { const { isFocused, types, selectedType, setSelectedType } = props; const items = types.map((type) => ({ label: type, value: type })); return (React.createElement(Pane, { isFocused: isFocused }, React.createElement(Text, { bold: true }, "Aggregate Types"), React.createElement(Box, { flexDirection: "column", width: "100%", marginTop: 1 }, React.createElement(SelectInput, { items: items, onSelect: (item) => setSelectedType(item.value), initialIndex: selectedType ? types.indexOf(selectedType) : 0, isFocused: isFocused })), React.createElement(Spacer, null), React.createElement(Box, { marginTop: 1 }, React.createElement(Text, { color: "gray" }, "\u2191/\u2193 : navigate \u2022 \u21B5 : select")))); };