Skip to content

Commit

Permalink
Add details json block file and remove ununsed import
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Apr 9, 2020
1 parent f710083 commit 5236ad7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React, { FunctionComponent } from 'react';
import { EuiCodeBlock, EuiText } from '@elastic/eui';

export interface Props {
htmlForId: string;
label: string;
json: Record<string, any>;
}

export const PipelineDetailsJsonBlock: FunctionComponent<Props> = ({ label, htmlForId, json }) => (
<>
<EuiText size="s">
<label htmlFor={htmlForId}>
<b>{label}</b>
</label>
</EuiText>
<EuiCodeBlock paddingSize="s" id={htmlForId} language="json" overflowHeight={200} isCopyable>
{JSON.stringify(json, null, 2)}
</EuiCodeBlock>
</>
);
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
EuiFlexItem,
EuiButtonEmpty,
EuiCallOut,
EuiLoadingSpinner,
} from '@elastic/eui';

import { EuiSpacer, EuiText } from '@elastic/eui';
Expand Down

0 comments on commit 5236ad7

Please sign in to comment.