Files
bootnode/web/lib/utils.ts
T
zeekay 73a3d23053 feat: production deployment with shared Hanzo infrastructure
- Add k8s configs for production deployment
- Use shared postgres/datastore in hanzo namespace
- Fix image registry to ghcr.io/hanzoai/bootnode
- Add deploy script with shared infra support
- Simplify compose.yml for local development
2026-02-02 16:39:52 -08:00

34 lines
900 B
TypeScript

import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function formatDate(date: Date | string | number): string {
return new Intl.DateTimeFormat("en-US", {
month: "short",
day: "numeric",
year: "numeric",
}).format(new Date(date))
}
export function formatNumber(num: number): string {
return new Intl.NumberFormat("en-US").format(num)
}
export function formatCompact(num: number): string {
return new Intl.NumberFormat("en-US", {
notation: "compact",
compactDisplay: "short",
}).format(num)
}
export function truncateAddress(address: string, chars = 4): string {
return `${address.slice(0, chars + 2)}...${address.slice(-chars)}`
}
export function sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms))
}