import Link from "next/link";
import { listUserProjects } from "@peppa/core";
import { AutoRefresh } from "@/components/AutoRefresh";
import { Flash, QuestionCard, SessionCard } from "@/components/ui";
import { requireUser } from "@/lib/auth";
import { db } from "@/lib/db";
import { activeSessions, inbox } from "@/lib/queries";
export default async function Inbox({ searchParams }: { searchParams: Promise<{ error?: string }> }) {
const user = await requireUser();
const { error } = await searchParams;
const [items, sessions, projects] = await Promise.all([inbox(user.id), activeSessions(user.id), listUserProjects(db, user.id)]);
return (
<>
Входящие {items.length > 0 && {items.length}}
{items.length === 0 ? Агентам от тебя ничего не нужно.
: items.map((q) => )}
Активные сессии
{sessions.length === 0 ? Сейчас ничего не запущено.
: sessions.map((s) => )}
Мои проекты
{projects.length === 0 ? (
Проектов пока нет. Создать первый
) : (
{projects.map((p) => (
-
{p.key} {p.name}
{p.ownerId !== user.id && общий} {p.giteaOwner}/{p.giteaRepo}
))}
)}
>
);
}