@carbon/ibm-cloud-cognitive-cdai
Version:
Carbon for Cloud & Cognitive CD&AI UI components
43 lines (42 loc) • 1.49 kB
JavaScript
//
// Copyright IBM Corp. 2020, 2020
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//
import React from 'react';
import PropTypes from 'prop-types';
import { idePrefix } from '../../globals/js/settings';
var componentName = 'ContextHeader';
export var ContextHeader = function ContextHeader(_ref) {
var namespace = _ref.namespace,
name = _ref.name,
task = _ref.task;
return /*#__PURE__*/React.createElement("div", {
className: "".concat(idePrefix, "-context-header")
}, /*#__PURE__*/React.createElement("span", {
className: "".concat(idePrefix, "-context-header--task")
}, task), /*#__PURE__*/React.createElement("span", {
className: "".concat(idePrefix, "-context-header--name")
}, name), /*#__PURE__*/React.createElement("span", {
className: "".concat(idePrefix, "-context-header--separator")
}, "|"), /*#__PURE__*/React.createElement("span", {
className: "".concat(idePrefix, "-context-header--namespace")
}, namespace));
};
ContextHeader.displayName = componentName;
ContextHeader.propTypes = {
/**
* The name of the current instance.
*/
name: PropTypes.string.isRequired,
/**
* The namespace in which the current instance is deployed.
*/
namespace: PropTypes.string.isRequired,
/**
* The high level task the user is using the embedding UI to carry out.
*/
task: PropTypes.string.isRequired
};
export default ContextHeader;