fix: sidebar width/centering + kanban card badge & table details
- Sidebar: expanded 256->200px, collapsed 80->64px; collapsed state now renders icon-only (label removed from flow) so icons are centered, not pushed left by an invisible text span - Kanban cards: add StatusBadge + email line to match design reference - Lead table: add "Mostrando N lead" footer and center/right-align Stato/Tag/Azioni headers per reference Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
} from "@dnd-kit/core";
|
||||
import { updateLeadField } from "@/app/admin/pipeline/actions";
|
||||
import type { LeadWithTags } from "@/lib/admin-queries";
|
||||
import { StatusBadge } from "@/components/ui/StatusBadge";
|
||||
|
||||
type LeadStage = "contacted" | "qualified" | "proposal_sent" | "negotiating" | "won" | "lost";
|
||||
|
||||
@@ -65,7 +66,7 @@ function DroppableColumn({
|
||||
|
||||
<div className="flex-1 space-y-2">
|
||||
{leads.map((lead) => (
|
||||
<DraggableLeadCard key={lead.id} lead={lead} isActive={activeId === lead.id} />
|
||||
<DraggableLeadCard key={lead.id} lead={lead} status={id} isActive={activeId === lead.id} />
|
||||
))}
|
||||
{leads.length === 0 && (
|
||||
<p className="text-xs text-muted-foreground italic text-center py-10 select-none">
|
||||
@@ -77,7 +78,15 @@ function DroppableColumn({
|
||||
);
|
||||
}
|
||||
|
||||
function DraggableLeadCard({ lead, isActive }: { lead: LeadWithTags; isActive: boolean }) {
|
||||
function DraggableLeadCard({
|
||||
lead,
|
||||
status,
|
||||
isActive,
|
||||
}: {
|
||||
lead: LeadWithTags;
|
||||
status: LeadStage;
|
||||
isActive: boolean;
|
||||
}) {
|
||||
const { attributes, listeners, setNodeRef, transform, isDragging } = useDraggable({ id: lead.id });
|
||||
|
||||
const style = transform
|
||||
@@ -94,9 +103,15 @@ function DraggableLeadCard({ lead, isActive }: { lead: LeadWithTags; isActive: b
|
||||
isDragging ? "opacity-30" : "hover:border-primary/30 hover:shadow-card-hover"
|
||||
}`}
|
||||
>
|
||||
<p className="text-sm font-medium text-foreground">{lead.name}</p>
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<p className="text-sm font-medium text-foreground">{lead.name}</p>
|
||||
<StatusBadge status={status} className="rounded px-1.5 py-0.5 text-[9px]" />
|
||||
</div>
|
||||
{lead.email && (
|
||||
<p className="text-xs text-muted-foreground mt-0.5 line-clamp-1">{lead.email}</p>
|
||||
)}
|
||||
{lead.company && (
|
||||
<p className="text-xs text-muted-foreground">{lead.company}</p>
|
||||
<p className="text-xs text-muted-foreground mt-1">{lead.company}</p>
|
||||
)}
|
||||
{lead.next_action && (
|
||||
<p className="text-xs text-muted-foreground mt-1 line-clamp-1">{lead.next_action}</p>
|
||||
|
||||
Reference in New Issue
Block a user