Rocky_Mountain_Vending/.pnpm-store/v10/files/3c/7f6f6c2d6c4b43f6611275e8bb100050fe4c3f58038470982d63ba10f2772ba912d0dbf965c4d84e596a0beddfefb2aa4266af9987adc0f07c24fd6bc8f569
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

101 lines
1.8 KiB
Text

const formatDistanceLocale = {
lessThanXSeconds: {
one: "menos de um segundo",
other: "menos de {{count}} segundos",
},
xSeconds: {
one: "1 segundo",
other: "{{count}} segundos",
},
halfAMinute: "meio minuto",
lessThanXMinutes: {
one: "menos de um minuto",
other: "menos de {{count}} minutos",
},
xMinutes: {
one: "1 minuto",
other: "{{count}} minutos",
},
aboutXHours: {
one: "aproximadamente 1 hora",
other: "aproximadamente {{count}} horas",
},
xHours: {
one: "1 hora",
other: "{{count}} horas",
},
xDays: {
one: "1 dia",
other: "{{count}} dias",
},
aboutXWeeks: {
one: "aproximadamente 1 semana",
other: "aproximadamente {{count}} semanas",
},
xWeeks: {
one: "1 semana",
other: "{{count}} semanas",
},
aboutXMonths: {
one: "aproximadamente 1 mês",
other: "aproximadamente {{count}} meses",
},
xMonths: {
one: "1 mês",
other: "{{count}} meses",
},
aboutXYears: {
one: "aproximadamente 1 ano",
other: "aproximadamente {{count}} anos",
},
xYears: {
one: "1 ano",
other: "{{count}} anos",
},
overXYears: {
one: "mais de 1 ano",
other: "mais de {{count}} anos",
},
almostXYears: {
one: "quase 1 ano",
other: "quase {{count}} anos",
},
};
export const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "daqui a " + result;
} else {
return "há " + result;
}
}
return result;
};