import { useQuery } from '@tanstack/react-query'; import { Link } from 'react-router-dom'; import { api } from '../../lib/api-client'; import { AppShell, PageHeader, PageBody } from '../../layout/AppShell'; import { Badge, Card, Skeleton } from '../../components/ui/primitives'; import { Table, THead, TBody, TR, TH, TD } from '../../components/ui/table'; interface BrandContent { slug: string; name: string; tagline: string | null; enabled: boolean; sort_order: number; product_count: number; updated_at: string; } export function BrandsList() { const { data, isLoading } = useQuery({ queryKey: ['brand-content'], queryFn: () => api.get<{ brands: BrandContent[] }>('/brands'), }); return ( {isLoading ? (
{[0, 1, 2, 3].map((i) => ( ))}
) : ( {(data?.brands ?? []).map((b) => ( ))}
Merk Tagline Producten Status
{b.name}

{b.slug}

{b.tagline ?? '—'} {b.product_count} {b.enabled ? actief : uit}
)}
); }