mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 02:57:59 +00:00
UI: code snippet component (#22518)
* VAULT-14763 make code snippet component * export component * add hds helper comment
This commit is contained in:
20
ui/lib/core/addon/components/code-snippet.hbs
Normal file
20
ui/lib/core/addon/components/code-snippet.hbs
Normal 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>
|
||||
Reference in New Issue
Block a user