Dashboard
- {/* KPI cards */}
-
+ {/* KPI cards + Follow-up Widget */}
+
+ Loading...
}>
+
+
{/* Activity feed */}
diff --git a/src/components/admin/dashboard/FollowUpWidget.tsx b/src/components/admin/dashboard/FollowUpWidget.tsx
new file mode 100644
index 0000000..dd782ea
--- /dev/null
+++ b/src/components/admin/dashboard/FollowUpWidget.tsx
@@ -0,0 +1,49 @@
+import { getLeadsNeedingFollowUp } from "@/lib/lead-service";
+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { Button } from "@/components/ui/button";
+import { AlertCircle } from "lucide-react";
+import Link from "next/link";
+
+export async function FollowUpWidget() {
+ const leadsNeedingFollowUp = await getLeadsNeedingFollowUp(7); // 7 days
+
+ return (
+
+
+
+
+ Richiesta Follow-up
+
+
+
+ {leadsNeedingFollowUp.length > 0 ? (
+ <>
+
+ {leadsNeedingFollowUp.length} lead
+ {leadsNeedingFollowUp.length !== 1 ? "s" : ""} da contattare
+
+
+ {leadsNeedingFollowUp.slice(0, 3).map((lead) => (
+ -
+ {lead.name}
+
+
+ ))}
+
+ {leadsNeedingFollowUp.length > 3 && (
+
+ )}
+ >
+ ) : (
+ Tutti i lead sono aggiornati!
+ )}
+
+
+ );
+}
diff --git a/src/components/admin/leads/LeadDetail.tsx b/src/components/admin/leads/LeadDetail.tsx
index a5fe2b5..4279e8b 100644
--- a/src/components/admin/leads/LeadDetail.tsx
+++ b/src/components/admin/leads/LeadDetail.tsx
@@ -7,6 +7,8 @@ import { Button } from "@/components/ui/button";
import { formatDistanceToNow, format } from "date-fns";
import { it } from "date-fns/locale";
import { EditLeadModal } from "./LeadForm";
+import { LogActivityModal } from "./LogActivityModal";
+import { SendQuoteModal } from "./SendQuoteModal";
const ACTIVITY_ICON: Record
= {
call: "📞",
@@ -43,7 +45,8 @@ export function LeadDetail({