- Added styles for player-side toast notifications to improve user feedback. - Adjusted padding and spacing in various components for a more cohesive layout. - Updated card and dialog components to streamline visual hierarchy and enhance readability. - Refactored player panel and navigation elements for better alignment and user experience.
19 lines
605 B
TypeScript
19 lines
605 B
TypeScript
import { clsx, type ClassValue } from "clsx"
|
||
import { twMerge } from "tailwind-merge"
|
||
|
||
export function cn(...inputs: ClassValue[]) {
|
||
return twMerge(clsx(inputs))
|
||
}
|
||
|
||
/** 幂等键:优先 Web Crypto,HTTP/旧环境回退为类 UUID 字符串 */
|
||
export function randomIdempotentKey(): string {
|
||
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
||
return crypto.randomUUID()
|
||
}
|
||
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
||
const r = (Math.random() * 16) | 0
|
||
const v = c === "x" ? r : (r & 0x3) | 0x8
|
||
return v.toString(16)
|
||
})
|
||
}
|