Skip to content

Commit

Permalink
Fixes #28802 - lint issue in empty state component
Browse files Browse the repository at this point in the history
  • Loading branch information
Ron-Lavi authored and tbrisker committed Feb 23, 2020
1 parent 4244ee6 commit bdbe179
Showing 1 changed file with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,37 @@ import SecondaryActionButtons from './EmptyStateSecondaryActionButtons';
import { defaultEmptyStatePropTypes } from './EmptyStatePropTypes';
import { translate as __ } from '../../../common/I18n';

const documentationBlock = ({
url,
label = __('For more information please see'),
buttonLabel = __('Documentation'),
}) =>
url && (
<React.Fragment>
{label}{' '}
<a href={url} target="_blank" rel="noopener noreferrer">
{buttonLabel}
</a>
</React.Fragment>
);

const DefaultEmptyState = props => {
const {
icon,
iconType,
header,
description,
documentation,
documentation: {
url,
label = __('For more information please see'),
buttonLabel = __('Documentation'),
} = {},
action,
secondaryActions,
} = props;

const documentationBlock = url ? (
<React.Fragment>
{label}{' '}
<a href={url} target="_blank" rel="noopener noreferrer">
{buttonLabel}
</a>
</React.Fragment>
) : null;

return (
<EmptyStatePattern
icon={icon}
iconType={iconType}
header={header}
description={description}
documentation={documentation ? documentationBlock(documentation) : null}
documentation={documentationBlock}
action={action ? <PrimaryActionButton action={action} /> : null}
secondaryActions={<SecondaryActionButtons actions={secondaryActions} />}
/>
Expand Down

0 comments on commit bdbe179

Please sign in to comment.