2023-09-03 08:07:26 +07:00
|
|
|
export function pluralize(count: number, s: string): string {
|
|
|
|
if (count === 1) {
|
|
|
|
return `1 ${s}`
|
|
|
|
} else {
|
|
|
|
return `${count} ${s}s`
|
|
|
|
}
|
|
|
|
}
|
2023-09-29 15:26:15 +07:00
|
|
|
|
|
|
|
export function capitalize(s: string): string {
|
|
|
|
return s.substring(0, 1).toUpperCase() + s.substring(1)
|
|
|
|
}
|
2024-01-30 12:51:13 +07:00
|
|
|
|
|
|
|
export function classNames(
|
|
|
|
displayClass?: "mobile-only" | "desktop-only",
|
|
|
|
...classes: string[]
|
|
|
|
): string {
|
|
|
|
if (displayClass) {
|
|
|
|
classes.push(displayClass)
|
|
|
|
}
|
|
|
|
return classes.join(" ")
|
|
|
|
}
|