feat(11-04): add client-side search bar to catalog page, remove ServiceForm

- New CatalogSearch client component: filters ServiceWithTags[] by name/tag, case-insensitive, instant (no reload)
- page.tsx now passes filtered services through CatalogSearch -> ServiceTable
- ServiceForm.tsx deleted — quick-add row in ServiceTable replaces its create-service UX
This commit is contained in:
2026-06-13 16:01:17 +02:00
parent c0bedf300e
commit 912a892ba5
3 changed files with 39 additions and 110 deletions
+3 -8
View File
@@ -1,6 +1,5 @@
import { getAllServices } from "@/lib/admin-queries";
import { ServiceTable } from "@/components/admin/catalog/ServiceTable";
import { ServiceForm } from "@/components/admin/catalog/ServiceForm";
import { CatalogSearch } from "./CatalogSearch";
export const revalidate = 0;
@@ -13,16 +12,12 @@ export default async function CatalogPage() {
<h1 className="text-2xl font-bold text-[#1a1a1a]">Catalogo Servizi</h1>
</div>
<div className="mb-6">
<ServiceForm />
</div>
{services.length === 0 ? (
<p className="text-sm text-[#71717a]">
Nessun servizio nel catalogo. Aggiungi il primo servizio qui sopra.
Nessun servizio nel catalogo. Scrivi un nome nella riga in fondo alla tabella e premi invio per crearne uno.
</p>
) : (
<ServiceTable services={services} />
<CatalogSearch services={services} />
)}
</div>
);