Files
BarevClub/apps/landing/app/[locale]/apartments/page.tsx
T

77 lines
3.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import '../../variants.css';
import '../../home.css';
import '../../service.css';
import '../../flats.css';
import type { Metadata, Viewport } from 'next';
import { notFound } from 'next/navigation';
import { Flats } from '../../../components/flats';
import { HomeFooter } from '../../../components/home';
import { VariantHeader } from '../../../components/variant';
import { getCatalog } from '../../../lib/data';
import { getFlats } from '../../../lib/flats';
// Квартиры из CRM меняются в течение дня — страница собирается на каждый запрос, список кешируется на минуту.
export const dynamic = 'force-dynamic';
export const dynamicParams = false;
/** Только русская версия (решение владельца, 20.10.2026) */
export function generateStaticParams() {
return [{ locale: 'ru' }];
}
export const metadata: Metadata = {
title: 'Квартиры в аренду в Ереване — запись на просмотр | Barev Club',
description: 'Проверенные квартиры от агентства-партнёра: фото, описание, цена. Выберите квартиру и удобный день — агент позвонит и покажет её.',
alternates: { canonical: '/ru/apartments' },
openGraph: {
title: 'Квартиры в аренду в Ереване',
locale: 'ru',
type: 'website',
siteName: 'Barev Club',
},
};
export const viewport: Viewport = { themeColor: '#4A1028' };
/** /ru/apartments — «Найдём квартиру»: объекты AREV из CRM и запись на просмотр */
export default async function Page({ params }: { params: Promise<{ locale: string }> }) {
const { locale } = await params;
if (locale !== 'ru') notFound();
const [flats, catalog] = await Promise.all([getFlats(), getCatalog()]);
const telegramUrl = `https://t.me/${catalog.botUsername}`;
return (
<div className="v2">
<div className="v-wrap">
<VariantHeader locale="ru" path="" className="vh--dark" logoColor="#F6C3D3" />
<nav className="s-crumbs" aria-label="Навигация">
<a href="/ru">Главная</a>
<span aria-hidden="true">/</span>
<span aria-current="page">Квартиры</span>
</nav>
<section className="fl-hero">
<h1 className="s-title">Найдём квартиру</h1>
<p className="s-lead">
Квартиры, которые агент уже проверил и согласовал с собственником. Листайте фото, читайте описание и выберите день — агент позвонит, подтвердит
время и покажет квартиру.
</p>
</section>
{flats?.length ? (
<Flats flats={flats} telegramUrl={telegramUrl} />
) : (
<section className="fl-empty">
<h2>{flats ? 'Сейчас свободных квартир нет' : 'Список квартир временно недоступен'}</h2>
<p>Напишите нам в Telegram — подберём варианты под ваш бюджет и район.</p>
<a className="bc-btn fl-book" href={telegramUrl}>
Написать в Telegram
</a>
</section>
)}
<HomeFooter locale="ru" />
</div>
</div>
);
}