Changed the dashboards
This commit is contained in:
@@ -28,11 +28,11 @@ function getStatusDistribution() {
|
||||
})
|
||||
|
||||
return [
|
||||
{ name: "Open", value: statusCounts.open, color: "#3b82f6" },
|
||||
{ name: "Contacted", value: statusCounts.contacted, color: "#f59e0b" },
|
||||
{ name: "Pending", value: statusCounts.pending, color: "#8b5cf6" },
|
||||
{ name: "Closed", value: statusCounts.closed, color: "#10b981" },
|
||||
{ name: "Ignored", value: statusCounts.ignored, color: "#6B7280" },
|
||||
{ name: "Open", value: statusCounts.open, color: "#0d9488" },
|
||||
{ name: "Contacted", value: statusCounts.contacted, color: "#5eead4" },
|
||||
{ name: "Pending", value: statusCounts.pending, color: "#c9a96e" },
|
||||
{ name: "Closed", value: statusCounts.closed, color: "#f43f5e" },
|
||||
{ name: "Ignored", value: statusCounts.ignored, color: "#94a3b8" },
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
+13
-7
@@ -26,22 +26,28 @@ const lastNames = ["Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "
|
||||
const sources = ["Website", "Referral", "LinkedIn", "Cold Call", "Email", "Google", "Social Media", "Other"]
|
||||
const statuses: LeadStatus[] = ["open", "contacted", "pending", "closed", "ignored"]
|
||||
|
||||
const phonePrefixes = ["555", "123", "456", "789", "321", "654", "987", "234", "876", "432"]
|
||||
|
||||
let _rngSeed = 42
|
||||
function rng(): number {
|
||||
_rngSeed = (_rngSeed * 1664525 + 1013904223) & 0x7fffffff
|
||||
return _rngSeed / 0x7fffffff
|
||||
}
|
||||
|
||||
function randomItem<T>(arr: T[]): T {
|
||||
return arr[Math.floor(Math.random() * arr.length)]
|
||||
return arr[Math.floor(rng() * arr.length)]
|
||||
}
|
||||
|
||||
function randomDate(startMonthsAgo: number): string {
|
||||
const now = new Date()
|
||||
const start = new Date(now.getFullYear(), now.getMonth() - startMonthsAgo, 1)
|
||||
const randomTime = start.getTime() + Math.random() * (now.getTime() - start.getTime())
|
||||
const randomTime = start.getTime() + rng() * (now.getTime() - start.getTime())
|
||||
return new Date(randomTime).toISOString()
|
||||
}
|
||||
|
||||
const phonePrefixes = ["555", "123", "456", "789", "321", "654", "987", "234", "876", "432"]
|
||||
|
||||
function randomPhone(): string {
|
||||
const prefix = randomItem(phonePrefixes)
|
||||
const suffix = Math.floor(Math.random() * 10000000).toString().padStart(7, "0")
|
||||
const suffix = Math.floor(rng() * 10000000).toString().padStart(7, "0")
|
||||
return `(${prefix}) ${suffix.slice(0, 3)}-${suffix.slice(3)}`
|
||||
}
|
||||
|
||||
@@ -49,7 +55,7 @@ export const leads: Lead[] = Array.from({ length: 120 }, (_, i) => {
|
||||
const firstName = randomItem(firstNames)
|
||||
const lastName = randomItem(lastNames)
|
||||
const status = randomItem(statuses)
|
||||
const assignedUser = Math.random() > 0.15 ? randomItem(users.filter((u) => u.active)) : null
|
||||
const assignedUser = rng() > 0.15 ? randomItem(users.filter((u) => u.active)) : null
|
||||
const createdAt = randomDate(6)
|
||||
|
||||
return {
|
||||
@@ -59,7 +65,7 @@ export const leads: Lead[] = Array.from({ length: 120 }, (_, i) => {
|
||||
email: `${firstName.toLowerCase()}.${lastName.toLowerCase()}@${companyNames[i % companyNames.length].toLowerCase().replace(/\s+/g, "")}.com`,
|
||||
phone: randomPhone(),
|
||||
source: randomItem(sources),
|
||||
description: `Looking for a complete website redesign and modern digital presence. Interested in responsive design, SEO optimization, and a custom CMS solution.`,
|
||||
description: "Looking for a complete website redesign and modern digital presence. Interested in responsive design, SEO optimization, and a custom CMS solution.",
|
||||
status,
|
||||
assignedUserId: assignedUser?.id ?? null,
|
||||
assignedUser,
|
||||
|
||||
Reference in New Issue
Block a user