UI: code snippet component (#22518)

* VAULT-14763 make code snippet component

* export component

* add hds helper comment
This commit is contained in:
claire bontempo
2023-08-22 16:36:51 -07:00
committed by GitHub
parent b45d944960
commit e4ce8729fd
4 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
<div class="code-snippet-container">
<code class="text-grey-lightest">
{{@codeBlock}}
</code>
{{! replace with Hds::Copy::Button }}
<CopyButton
class="code-snippet-copy-button"
@clipboardText={{or @clipboardCode @codeBlock}}
@buttonType="button"
@success={{action (set-flash-message "Code copied!")}}
>
Copy
<Icon @name="clipboard-copy" aria-label="Copy" />
</CopyButton>
</div>