[FE][Certs] Copy cert code on click
This commit is contained in:
parent
2bd0c2c695
commit
0d58e930ed
@ -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">
|
||||
- {props.register.register_code}
|
||||
-
|
||||
</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>
|
||||
|
Loading…
Reference in New Issue
Block a user