import { createT, formatAmd, isLocale, LOCALES, type Locale } from '@barev/i18n'; import { Icon } from '@barev/ui'; import { notFound } from 'next/navigation'; import { LegalShell, legalMetadata } from '../../../components/legal'; import { getCatalog } from '../../../lib/data'; export const revalidate = 300; export const dynamicParams = false; export function generateStaticParams() { return LOCALES.map((locale) => ({ locale })); } export function generateMetadata({ params }: { params: Promise<{ locale: string }> }) { return legalMetadata(params, 'pricing'); } interface Row { id: string; price: string; vars?: Record; href?: string; } /** * Цены: подписки клуба и услуги, которые сейчас продаются. Все суммы — из настроек админки * (как на главной и страницах услуг), поэтому страница не расходится с ботом. */ export default async function Pricing({ params }: { params: Promise<{ locale: string }> }) { const { locale: raw } = await params; if (!isLocale(raw)) notFound(); const locale: Locale = raw; const t = createT(locale); const amd = (n: number) => formatAmd(locale, n); const { offer, barevPlus, categories } = await getCatalog(); const cleaning = categories.find((c) => c.code === 'HOME')?.services.find((s) => s.code === 'cleaning')?.fromPrice ?? 0; const from = (n: number) => t('pricing.from', { price: amd(n) }); const plans = [ { id: 'free', name: 'Barev', price: t('landing.club.free'), pct: 0 }, { id: 'plus', name: 'Barev+', price: t('landing.club.perMonth', { price: amd(barevPlus.monthlyPrice) }), pct: offer.plusMaxPct }, { id: 'elite', name: 'Barev Elite', price: t('landing.club.perMonth', { price: amd(offer.elitePrice) }), pct: offer.eliteMaxPct }, ] as const; const groups: { id: 'HOME' | 'DOCS'; rows: Row[] }[] = [ { id: 'HOME', rows: [ { id: 'cleaning', price: from(cleaning), href: '/clean' }, { id: 'transferStandard', price: amd(offer.transferStandard), href: '/airport' }, { id: 'transferPremium', price: amd(offer.transferPremium), href: '/airport' }, { id: 'hotel', price: t('pricing.perDay', { price: from(offer.hotelWithPlus) }), vars: { base: amd(offer.hotelBase) } }, ], }, { id: 'DOCS', rows: [ { id: 'socialCard', price: amd(offer.socialCard), href: '/social-card' }, { id: 'consultation', price: amd(offer.consultation), href: '/residence-permit' }, { id: 'residence', price: from(offer.residenceEscortFrom), vars: { fee: amd(offer.residenceStateFee) }, href: '/residence-permit' }, ], }, ]; return (

{t('pricing.plansTitle')}

{t('pricing.plansNote')}

{plans.map((p) => (

{p.name}

{p.price}
    {[1, 2, 3].map((n) => (
  • {t(`landing.club.${p.id}F${n}`, { pct: p.pct })}
  • ))}
{t(`pricing.planNote.${p.id}`, { days: barevPlus.giftDays })}
))}

{t('pricing.servicesTitle')}

{t('pricing.servicesNote')}

{groups.map((g) => (

{t(`categories.${g.id}.name`)}

{g.rows.map((r) => (
{r.href ? {t(`pricing.rows.${r.id}.name`)} : t(`pricing.rows.${r.id}.name`)} {t(`pricing.rows.${r.id}.note`, r.vars)}
{r.price}
))}
))}

{t('pricing.payTitle')}

{t('pricing.payBody')}

{t('landing.footer.terms')} · {t('landing.footer.refund')}

); }