(this.ace_viewer = e)} />
{hasButton && (
{this.props.copyButton && (
copyToClipboard(this.editor.session.getValue())}
>
)}
{this.props.downloadButton && (
downloadObject(
this.props.downloadFileName,
this.editor.session.getValue()
)
}
>
)}
)}
);
}
}
function getMode(docType) {
if (docType === 'json') {
return 'ace/mode/json';
}
return 'ace/mode/yaml';
}
const EditorButton = styled(ButtonSecondary)`
padding: ${({ theme }) => theme.space[2]}px;
background-color: transparent;
`;
const ButtonSection = styled(Flex)`
position: absolute;
right: 0;
top: 0;
z-index: 10;
`;
export default TextEditor;