toHex, basic deleteDownload func, fix badge display token

This commit is contained in:
2024-12-23 18:49:50 -06:00
parent b5967ca799
commit a8725ea5cb
3 changed files with 26 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
import Badge from "@/components/Badge";
import Emboldened from "@/components/Emboldened";
import useSocket from "@/components/useSocket";
import { cn, plural, type ClassValue } from "@/util";
import { cn, plural, toHex, type ClassValue } from "@/util";
import { useRef, useState } from "preact/hooks";
type DemoProps = {
@@ -42,7 +42,7 @@ const Demo = ({ class: className }: DemoProps) => {
<br />
Your session is{" "}
<Emboldened skeletonWidth="0x1234567890ABCDEF" copyable={true}>
{id != null ? "0x" + id?.toString(16).toUpperCase() : null}
{id != null ? toHex(id) : null}
</Emboldened>
. You have{" "}
<Emboldened className="text-teal-400 font-inter">
@@ -66,7 +66,7 @@ const Demo = ({ class: className }: DemoProps) => {
audio.play();
}}
>
{download}
{toHex(download.token)}
</Badge>
))}
</div>