добавлена форма заявки тестовая, тестовая сттраница crm база данных
Some checks failed
Auto Deploy / deploy (push) Failing after 45s

This commit is contained in:
deonisii
2026-04-17 16:10:29 +03:00
parent b4325ec1fa
commit 64e8a4427d
15 changed files with 2051 additions and 45 deletions

56
app/admin/leads/page.tsx Normal file
View File

@@ -0,0 +1,56 @@
import { prisma } from "@/lib/prisma";
export const dynamic = "force-dynamic";
export default async function AdminLeadsPage() {
const leads = await prisma.lead.findMany({
orderBy: { createdAt: "desc" },
});
return (
<main className="min-h-screen bg-neutral-950 text-white">
<div className="max-w-6xl mx-auto px-4 sm:px-6 py-10">
<h1 className="text-3xl font-bold mb-8">Заявки</h1>
<div className="overflow-x-auto rounded-2xl border border-white/10 bg-neutral-900">
<table className="w-full text-sm">
<thead className="border-b border-white/10 text-neutral-400">
<tr>
<th className="text-left px-4 py-3">Дата</th>
<th className="text-left px-4 py-3">Компания</th>
<th className="text-left px-4 py-3">Телефон</th>
<th className="text-left px-4 py-3">Сообщение</th>
<th className="text-left px-4 py-3">Статус</th>
<th className="text-left px-4 py-3">Источник</th>
</tr>
</thead>
<tbody>
{leads.map((lead) => (
<tr key={lead.id} className="border-b border-white/5 align-top">
<td className="px-4 py-3 whitespace-nowrap">
{new Date(lead.createdAt).toLocaleString("ru-RU")}
</td>
<td className="px-4 py-3">{lead.company}</td>
<td className="px-4 py-3">{lead.phone}</td>
<td className="px-4 py-3 text-neutral-300">
{lead.message || "—"}
</td>
<td className="px-4 py-3">{lead.status}</td>
<td className="px-4 py-3">{lead.source}</td>
</tr>
))}
{leads.length === 0 && (
<tr>
<td colSpan={6} className="px-4 py-8 text-center text-neutral-400">
Пока заявок нет
</td>
</tr>
)}
</tbody>
</table>
</div>
</div>
</main>
);
}