{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

<div class="console-ui-output">
  <JsonEditor
    @showToolbar={{false}}
    @value={{stringify this.content}}
    @readOnly={{true}}
    {{! ideally we calculate the "height" of the json data, but 100 should cover most cases }}
    @viewportMargin="100"
    @gutters={{false}}
    @theme="hashi auto-height"
  />
  <Hds::Copy::Button
    @text="Copy"
    @isIconOnly={{true}}
    @textToCopy={{stringify this.content}}
    @onError={{(fn (set-flash-message "Clipboard copy failed. The Clipboard API requires a secure context." "danger"))}}
    class="transparent icon-grey-500 top-right-absolute"
  />
</div>