[FE][Certs] Copy cert code on click

This commit is contained in:
Araozu 2023-10-25 15:30:09 -05:00
parent 2bd0c2c695
commit 0d58e930ed

View File

@ -254,7 +254,17 @@ function RegisterEl(props: {register: Register, person: Person, onClick: () => v
</Show>
<Show when={!props.register.register_is_preview}>
<span class="font-mono">
&nbsp;- {props.register.register_code}
&nbsp;-&nbsp;
</span>
<span
class="font-mono underline cursor-pointer hover:text-c-primary"
onClick={() => {
const code = props.register.register_code.toString();
const paddedCode = code.padStart(4, "0");
navigator.clipboard.writeText(paddedCode);
}}
>
{props.register.register_code}
</span>
</Show>
</p>