import { createT, formatAmd, isLocale, LOCALES, type Locale } from '@barev/i18n'; import { Icon } from '@barev/ui'; import type { Metadata } from 'next'; import { getCatalog, type LandingOffer } from '../lib/data'; import { BotLink } from './client'; import { SERVICE_PAGES } from '../lib/services'; import { LegalLinks } from './legal'; import { FooterContacts, LegalLine } from './seo'; /** Главная (/) и «Уже живу» (/live): индексируются, у каждой свой canonical и hreflang */ export async function homeMetadata(params: Promise<{ locale: string }>, path: '' | '/live'): Promise { const { locale } = await params; if (!isLocale(locale)) return {}; const t = createT(locale); const { offer } = await getCatalog(); const title = t(path ? 'landing.live.metaTitle' : 'landing.home.metaTitle'); const description = t(path ? 'landing.live.metaDescription' : 'landing.home.metaDescription', { pct: offer.eliteMaxPct }); return { title, description, alternates: { canonical: `/${locale}${path}`, languages: Object.fromEntries([...LOCALES.map((l) => [l, `/${l}${path}`]), ['x-default', `/ru${path}`]]), }, openGraph: { title, description, locale, type: 'website', siteName: 'Barev Club' }, }; } /** Переключатель аудитории: две версии главной — «Переезжаю» и «Уже живу в Армении» */ export function AudienceSwitch({ locale, current }: { locale: Locale; current: 'move' | 'live' }) { const t = createT(locale); return ( ); } /** * Тарифы как клубные карты: Barev — прозрачная, Barev+ — розовая, Elite — жёлтая. * Оформление подписки — в боте, поэтому все кнопки ведут туда. */ export function ClubPlans({ locale, plusPrice, offer }: { locale: Locale; plusPrice: number; offer: LandingOffer }) { const t = createT(locale); const amd = (n: number) => formatAmd(locale, n); const plans = [ { id: 'free', name: 'Barev', price: t('landing.club.free'), cta: t('landing.club.freeCta') }, { id: 'plus', name: 'Barev+', price: t('landing.club.perMonth', { price: amd(plusPrice) }), cta: t('landing.club.plusCta') }, { id: 'elite', name: 'Barev Elite', price: t('landing.club.perMonth', { price: amd(offer.elitePrice) }), cta: t('landing.club.eliteCta') }, ] as const; return (

{t('landing.club.title')}

{t('landing.club.sub')}

{plans.map((p) => (
Barev Club
    {[1, 2, 3].map((n) => (
  • {t(`landing.club.${p.id}F${n}`, { pct: p.id === 'elite' ? offer.eliteMaxPct : offer.plusMaxPct })}
  • ))}
{p.cta}
))}
); } export function HomeFooter({ locale }: { locale: Locale }) { const t = createT(locale); return ( ); }