Sha256: 601ce1b743f6c472fdd28676b372a203f9a49b5b61dc7ace295b84312c74ef2c
Contents?: true
Size: 1.34 KB
Versions: 26
Compression:
Stored size: 1.34 KB
Contents
import React from 'react'; import { PropTypes } from 'prop-types'; import { Flex, FlexItem, Label, Text, } from '@patternfly/react-core'; import { ExclamationTriangleIcon } from '@patternfly/react-icons'; import { global_warning_color_100 as warningColor, } from '@patternfly/react-tokens'; const ActionSummary = ({ title, text, selectedEnv: { name, id } }) => ( <div> {title && <h3 style={{ margin: '8px 0' }}><b>{title}</b></h3> } {text && <Flex> <FlexItem style={{ marginRight: '8px' }}> <ExclamationTriangleIcon color={warningColor.value} /> </FlexItem> <FlexItem style={{ marginRight: '8px' }}> <Text>{text}</Text> </FlexItem> {name && id && <FlexItem> <Label isTruncated color="purple" href={`/lifecycle_environments/${id}`}>{name}</Label> </FlexItem> } </Flex> } </div>); ActionSummary.propTypes = { title: PropTypes.oneOfType([ PropTypes.string, PropTypes.object, // React component ]), text: PropTypes.oneOfType([ PropTypes.string, PropTypes.object, // React component ]), selectedEnv: PropTypes.shape({ id: PropTypes.number, name: PropTypes.string, }), }; ActionSummary.defaultProps = { title: undefined, text: undefined, selectedEnv: {}, }; export default ActionSummary;
Version data entries
26 entries across 26 versions & 1 rubygems