Sha256: 30ec06c6ddf5eb59733bb296f33fc49a8ba9cafbdb1d23b2485e9884adbdfd55
Contents?: true
Size: 1.15 KB
Versions: 15
Compression:
Stored size: 1.15 KB
Contents
import React from 'react'; import { EmptyState, EmptyStateBody, EmptyStateIcon, EmptyStateVariant, Bullseye, Title } from '@patternfly/react-core'; import PropTypes from 'prop-types'; import { CubeIcon, ExclamationCircleIcon } from '@patternfly/react-icons'; import { global_danger_color_200 as dangerColor } from '@patternfly/react-tokens'; const EmptyStateMessage = ({ title, body, error }) => ( <Bullseye> <EmptyState variant={EmptyStateVariant.small}> {error ? <EmptyStateIcon icon={ExclamationCircleIcon} color={dangerColor.value} /> : <EmptyStateIcon icon={CubeIcon} />} <Title headingLevel="h2" size="lg"> {title} </Title> <EmptyStateBody> {body} </EmptyStateBody> </EmptyState> </Bullseye> ); EmptyStateMessage.propTypes = { title: PropTypes.string, body: PropTypes.string, error: PropTypes.oneOfType([ PropTypes.shape({}), PropTypes.string, ]), }; EmptyStateMessage.defaultProps = { title: 'Unable to retrieve information from the server.', body: 'Please check the server logs for more information', error: undefined, }; export default EmptyStateMessage;
Version data entries
15 entries across 15 versions & 1 rubygems