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" > - - - - - + + + + +