UNPKG

nice-ui

Version:

React design system, components, and utilities

24 lines (23 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CommandParameter = void 0; const React = require("react"); const Code_1 = require("../../../1-inline/Code"); const nano_theme_1 = require("nano-theme"); const CommandParameter = ({ label, value, active }) => { const theme = (0, nano_theme_1.useTheme)(); const quote = typeof value === 'string' ? React.createElement("span", { style: { color: theme.color.sem.positive[1] } }, '"') : null; const valueFormatted = React.createElement("span", { style: { color: theme.g(0) } }, String(value)); const equal = React.createElement("span", { style: { color: theme.g(0.5) } }, "="); const labelFormatted = React.createElement("span", { style: { color: active ? theme.color.sem.negative[1] : theme.g(0.5) } }, label); return (React.createElement(Code_1.Code, { gray: true, noBg: true }, labelFormatted, " ", equal, ' ', React.createElement("strong", null, quote, valueFormatted, quote))); }; exports.CommandParameter = CommandParameter;