File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 1+ <script lang =" ts" >
2+ import Clipboard from " @lucide/svelte/icons/clipboard"
3+ import ClipboardCheck from " @lucide/svelte/icons/clipboard-check"
4+ let { uuid }: { uuid: string } = $props ()
5+ let copied = $state (false )
6+ console .log (uuid )
7+ </script >
8+
9+ <button
10+ class =" mx-auto btn cursor-pointer rounded-md preset-outlined-surface-500 p-2 text-xs"
11+ type =" button"
12+ onclick ={async (e ) => {
13+ e .preventDefault ()
14+ await navigator .clipboard .writeText (uuid )
15+ copied = true
16+ setTimeout (() => (copied = false ), 2000 )
17+ }}
18+ >
19+ ID: <span class ="w-18 truncate" >{uuid }</span >
20+ {#if copied }
21+ <ClipboardCheck class =" h-4" />
22+ {:else }
23+ <Clipboard class =" h-4" />
24+ {/if }
25+ </button >
Original file line number Diff line number Diff line change 77 import Landmark from " @lucide/svelte/icons/landmark"
88 import Package from " @lucide/svelte/icons/package"
99 import Settings from " @lucide/svelte/icons/settings"
10+ import UUID from " $lib/components/UUID.svelte"
1011
1112 const { data, children } = $props ()
1213
2627 <span class =" my-auto" >
2728 {data .scripter .profiles .username }
2829 </span >
29- <small class ="my-auto" >{data .scripter .id }</small >
30+ <small class ="my-auto" >< UUID uuid = {data .scripter .id }></ UUID > </small >
3031 </h3 >
3132
3233 <div class =" my-8 grid place-items-center" >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import UUID from " $lib/components/UUID.svelte"
23 import StatsHeader from " ./StatsHeader.svelte"
34
45 const data = $props ()
2829 {description ?? " Loading..." }
2930 </h2 >
3031 <h3 class =" my-4" >
31- {id ?? " Loading..." }
32+ < UUID uuid = {id ?? " Loading..." }></ UUID >
3233 </h3 >
3334 <StatsHeader {id } />
3435 </div >
Original file line number Diff line number Diff line change 44 import { zodClient } from " sveltekit-superforms/adapters"
55 import Head from " $lib/components/Head.svelte"
66 import { superForm } from " sveltekit-superforms"
7+ import UUID from " $lib/components/UUID.svelte"
78
89 const { data, form } = $props ()
910 const profile = $derived (data .profile ! )
3031<main class =" container mx-auto my-6 flex max-w-3xl flex-col" >
3132 <header class =" my-24 flex flex-col" >
3233 <h1 class ="mx-auto my-2 text-3xl font-bold" >Username: {profile .username }</h1 >
33- <h2 class = "mx-auto my-8 leading-normal font-semibold" >ID: {profile .id }</ h2 >
34+ <UUID uuid = {profile .id }></ UUID >
3435 </header >
3536
3637 <RoleBadge />
You can’t perform that action at this time.
0 commit comments