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