feat: update layout, add copy key

This commit is contained in:
2024-08-17 00:51:57 +07:00
parent f503b261f5
commit fb02d273c2
8 changed files with 141 additions and 34 deletions
+9
View File
@@ -22,3 +22,12 @@ export const readableBytes = (bytes?: number | null, divider = 1024) => {
export const handleError = (err: unknown) => {
toast.error((err as Error)?.message || "Unknown error");
};
export const copyToClipboard = async (text: string) => {
try {
await navigator.clipboard.writeText(text);
toast.success("Copied to clipboard");
} catch (err) {
handleError(err);
}
};