feat(21-22): agente AI generazione preventivo + pagina pubblica deck

- Migration 0010: tabella proposals (id, slug, lead_id, client_id,
  offer_macro_id, content jsonb, state, selected_tier, accepted_at)
  applicata a prod via SSH tunnel
- @anthropic-ai/sdk@0.105.0 installato; ANTHROPIC_API_KEY in .env.local
- src/lib/proposal/: schema Zod ProposalContent, agente Claude Opus 4.8,
  assemble (AI + offerta DB + config consulente), queries, profile.ts
- Admin: /admin/preventivi lista + /genera (pre-fill ?lead_id=X) + /[id] review
- Sidebar: voce Preventivi + CTA globale lime "Genera preventivo"
- LeadDetail: pulsante "Genera preventivo" → /admin/preventivi/genera?lead_id=X
- Pagina pubblica /preventivo/[slug]: deck 20+ slide light-mode iamcavalli,
  navigazione frecce + dot + keyboard, accept/reject con guard immutabilità
- STATE.md aggiornato (80%), 21-PLAN.md scritto nel formato GSD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 14:37:05 +02:00
parent 86c86cd420
commit fdcc938252
41 changed files with 2818 additions and 19 deletions
@@ -0,0 +1,50 @@
import type { ConsultantProfile } from "@/lib/proposal/profile";
import { CheckCircle2 } from "lucide-react";
type Props = { consultant: ConsultantProfile };
export function StrategistSection({ consultant }: Props) {
return (
<div className="min-h-screen flex items-center px-16 py-24">
<div className="grid grid-cols-3 gap-12 w-full">
{/* Foto */}
<div className="flex flex-col items-center justify-center">
<div className="w-48 h-64 rounded-xl border-2 border-primary bg-muted flex items-center justify-center overflow-hidden">
{consultant.photoUrl ? (
<img src={consultant.photoUrl} alt={consultant.name} className="w-full h-full object-cover" />
) : (
<span className="text-muted-foreground text-sm">{consultant.name[0]}</span>
)}
</div>
</div>
{/* Bio */}
<div className="col-span-2 space-y-6">
<div>
<p className="text-xs font-mono tracking-widest text-muted-foreground uppercase">
Strategist · Brand &amp; Business
</p>
<h2 className="text-4xl font-light text-foreground mt-2">{consultant.name}</h2>
</div>
<p className="text-base font-medium text-foreground leading-relaxed">{consultant.bio}</p>
<ul className="space-y-2">
{consultant.credentials.map((c, i) => (
<li key={i} className="flex items-start gap-2 text-sm text-muted-foreground">
<CheckCircle2 size={14} className="text-primary mt-0.5 shrink-0" />
<span dangerouslySetInnerHTML={{ __html: c }} />
</li>
))}
</ul>
<div className="p-4 bg-muted rounded-lg text-sm text-foreground leading-relaxed border-l-2 border-primary">
{consultant.contact.website && (
<span className="font-mono text-xs text-muted-foreground">{consultant.contact.website}</span>
)}
</div>
</div>
</div>
</div>
);
}