fix: flag A/B/C persistence, catalog sort+reorder, offer category pools

- Fix duplicate tier INSERT bug (useState not syncing after router.refresh)
- Add column sort by clicking headers in service catalog
- Add drag-and-drop column reordering (persisted in localStorage)
- Add Categorie Offerta section in Impostazioni (tipo/obiettivo/categoria pools)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 12:12:49 +02:00
parent ba3e824157
commit 320827e13a
9 changed files with 654 additions and 216 deletions
@@ -0,0 +1,43 @@
"use client";
import { PoolManager } from "./PoolManager";
import { addPoolValue, removePoolValue } from "@/app/admin/impostazioni/actions";
export function OfferPoolsSection({
tipoPool,
obiettivoPool,
categoriaPool,
}: {
tipoPool: string[];
obiettivoPool: string[];
categoriaPool: string[];
}) {
return (
<div className="bg-white rounded-xl border border-[#e5e7eb] p-6">
<h2 className="text-base font-semibold text-[#1a1a1a] mb-1">Categorie Offerta</h2>
<p className="text-xs text-[#71717a] mb-5">
Valori disponibili nei campi Tipo, Obiettivo e Categoria dell&apos;editor offerte.
</p>
<div className="flex flex-wrap gap-6">
<PoolManager
label="Tipo offerta"
pool={tipoPool}
onAdd={(v) => addPoolValue("tipo", v)}
onRemove={(v) => removePoolValue("tipo", v)}
/>
<PoolManager
label="Obiettivo"
pool={obiettivoPool}
onAdd={(v) => addPoolValue("obiettivo", v)}
onRemove={(v) => removePoolValue("obiettivo", v)}
/>
<PoolManager
label="Categoria"
pool={categoriaPool}
onAdd={(v) => addPoolValue("categoria", v)}
onRemove={(v) => removePoolValue("categoria", v)}
/>
</div>
</div>
);
}