From 9b861759297680e1fe6a846bed5193dfbfc98be5 Mon Sep 17 00:00:00 2001 From: deonisii Date: Fri, 17 Apr 2026 23:49:12 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=D1=8B=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=80=D1=83=D1=81=D1=81=D0=BA=D0=BE=D0=BC=20?= =?UTF-8?q?=D1=8F=D0=B7=D1=8B=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/leads/page.tsx | 27 ++++++++---- components/lead-status-select.tsx | 59 ++++++++++++++++++--------- middleware.ts | 68 +++++++++++++++++++------------ 3 files changed, 103 insertions(+), 51 deletions(-) diff --git a/app/admin/leads/page.tsx b/app/admin/leads/page.tsx index 7292d35..10849ab 100644 --- a/app/admin/leads/page.tsx +++ b/app/admin/leads/page.tsx @@ -8,6 +8,15 @@ type SearchParams = Promise<{ status?: string; }>; +function formatLeadNumber(id: string, createdAt: Date) { + const date = new Date(createdAt); + const y = date.getFullYear(); + const m = String(date.getMonth() + 1).padStart(2, "0"); + const d = String(date.getDate()).padStart(2, "0"); + + return `WP-${y}${m}${d}-${id.slice(-6).toUpperCase()}`; +} + export default async function AdminLeadsPage({ searchParams, }: { @@ -64,11 +73,11 @@ export default async function AdminLeadsPage({ className="rounded-2xl border border-white/10 bg-neutral-900 px-4 py-3 outline-none" > - - - - - + + + + +