import React from 'react'; import { TextListItem, TextListItemVariants, Tooltip, TooltipPosition, } from '@patternfly/react-core'; import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons'; import PropTypes from 'prop-types'; import EditableTextInput from './EditableTextInput'; import EditableSwitch from './EditableSwitch'; // To be used within a TextList const ActionableDetail = ({ attribute, label, value, textArea, boolean, tooltip, onEdit, currentAttribute, setCurrentAttribute, disabled, }) => { const displayProps = { attribute, value, onEdit, disabled, }; return ( {label} {tooltip && } {boolean ? : } ); }; ActionableDetail.propTypes = { attribute: PropTypes.string.isRequired, // back-end name for API call label: PropTypes.string.isRequired, // displayed label value: PropTypes.oneOfType([ // displayed value PropTypes.string, PropTypes.bool, ]), onEdit: PropTypes.func.isRequired, textArea: PropTypes.bool, boolean: PropTypes.bool, tooltip: PropTypes.string, currentAttribute: PropTypes.string, setCurrentAttribute: PropTypes.func, disabled: PropTypes.bool, }; ActionableDetail.defaultProps = { textArea: false, boolean: false, tooltip: null, value: null, currentAttribute: undefined, setCurrentAttribute: undefined, disabled: false, }; export default ActionableDetail;