import moment from 'moment'; import { twMerge } from 'tailwind-merge'; import clsx, { ClassValue } from 'clsx'; export const sleep = (ms: number = 1000) => new Promise((resolve) => setTimeout(resolve, ms)); export const formatDate = (date: moment.MomentInput, format?: string) => { return moment(date).format(format); }; export const cn = (...inputs: ClassValue[]) => { return twMerge(clsx(inputs)); }; export const formatCurrency = ( value: number | bigint | Intl.StringNumericLiteral, currency = 'USD', locale = 'en-US', minimumFractionDigits = 0, maximumFractionDigits = 2 ) => { return new Intl.NumberFormat(locale, { style: 'currency', currency, minimumFractionDigits, maximumFractionDigits, }).format(value); };