Files
zeropost-tool/app/channels/[id]/page.js
T
Alexey Pavlov 5dd975a9cd feat: zeropost-tool — Next.js 16 кабинет
- Auth: iron-session, регистрация/логин по email+password
- Дашборд со списком каналов
- 3-шаговая анкета создания канала (база/стиль/примеры+табу)
- Страница канала с генератором постов через polling
- Тёмная тема, Tailwind 3.4, accent emerald
- Прокси-API к zeropost-engine с x-user-id
- Совместимость с Next 16 async cookies/params
2026-05-31 08:38:10 +03:00

27 lines
628 B
JavaScript

import { notFound, redirect } from 'next/navigation';
import { requireUser } from '@/lib/session';
import { engine } from '@/lib/engine';
import Header from '@/components/Header';
import ChannelView from '@/components/ChannelView';
export default async function ChannelPage({ params }) {
const user = await requireUser();
if (!user) redirect('/login');
const { id } = await params;
let channel;
try {
channel = await engine.getChannel(user.id, id);
} catch {
notFound();
}
if (!channel) notFound();
return (
<>
<Header user={user} />
<ChannelView channel={channel} />
</>
);
}