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:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user