mirror of
https://github.com/we-promise/sure.git
synced 2026-09-05 23:01:26 +00:00
The key-reveal partial binds clipboard#copy on a DS::Button but never set copied-text-value, so the controller's flashLabel path bailed out and copying gave no visible confirmation. Add the value (mirroring the MCP copy button fix from #2314) so the button label flashes "Copied!". Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
18 lines
818 B
ERB
18 lines
818 B
ERB
<%# locals: (api_key:, heading:, description:, copy_label:) %>
|
|
<div class="bg-surface-inset rounded-xl p-4">
|
|
<h4 class="font-medium text-primary mb-3"><%= heading %></h4>
|
|
<p class="text-secondary text-sm mb-3"><%= description %></p>
|
|
|
|
<div class="@container bg-container rounded-lg p-3 border border-primary" data-controller="clipboard" data-clipboard-copied-text-value="<%= t(".copied") %>">
|
|
<div class="flex flex-col items-start gap-3 @lg:flex-row @lg:items-center @lg:justify-between">
|
|
<code class="font-mono text-sm text-primary break-all min-w-0" data-clipboard-target="source"><%= api_key.plain_key %></code>
|
|
<%= render DS::Button.new(
|
|
text: copy_label,
|
|
variant: "ghost",
|
|
icon: "copy",
|
|
data: { action: "clipboard#copy" }
|
|
) %>
|
|
</div>
|
|
</div>
|
|
</div>
|