import '../../variants.css'; import { quote } from '@barev/core'; import { createT, formatAmd, isLocale, LOCALES, type Locale } from '@barev/i18n'; import { CATEGORY_ICON, Icon, type CategoryCode } from '@barev/ui'; import { notFound } from 'next/navigation'; import { BotLink, BotLinkProvider } from '../../../components/client'; import { VariantHeader, variantMetadata } from '../../../components/variant'; import { getCatalog, getCleaning } 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 variantMetadata(params, '/land1', 'landing.v1.title'); } /** Версия 1 «Чат»: продукт живёт в Telegram, поэтому страница — переписка с ботом, кнопки — как inline-клавиатура */ export default async function Land1({ 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 [catalog, cleaning] = await Promise.all([getCatalog(), getCleaning()]); // цена в диалоге — настоящая: обычная уборка, 2 комнаты, 1 санузел const demoPrice = quote(cleaning.pricing, { cleaningType: 'regular', rooms: 2, bathrooms: 1 }).totalPrice; const groups = catalog.categories.filter((c) => c.code !== 'PERKS' && c.services.length > 0); const chat = [ { from: 'me', text: t('landing.v1.u1'), time: '10:02' }, { from: 'bot', text: t('landing.v1.b1', { price: amd(demoPrice) }), time: '10:02' }, { from: 'me', text: t('landing.v1.u2'), time: '10:03' }, { from: 'bot', text: t('landing.v1.b2'), time: '10:03' }, ] as const; return (

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

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

{t('landing.v1.botName')} {t('landing.v1.botStatus')}
    {chat.map((m, i) => (
  1. {m.text}
  2. ))}
{/* как inline-клавиатура под последним сообщением бота */}
{t('landing.hero.cleanCta')} {t('landing.v1.cta')}

{t('landing.v1.canTitle')}

{t('landing.v1.canText')}

{groups.map((g) => (

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

{g.services.map((s) => s.code === 'cleaning' && s.active ? ( {t(`services.${s.code}.name`)} {t('common.from', { price: amd(s.fromPrice) })} ) : (
{t(`services.${s.code}.name`)} {s.active ? t('common.from', { price: amd(s.fromPrice) }) : t('common.soon')}
), )}
))}

{t('landing.v1.whyTitle')}

{([1, 2, 3] as const).map((n) => (
{t(`landing.v1.why${n}`)} {t(`landing.v1.why${n}Sub`)}
))}

{t('landing.v1.ctaTitle')}

{t('landing.v1.ctaText')}

{/* поле ввода сообщения: «Barev!» уже набрано, кнопка отправки открывает бота */} Barev! {t('landing.v1.cta')}
); }