import type { WpPostCollectionStatus } from '../../../hooks/useWpPostStatusCounts'; export type StatusPillDef = { id: WpPostCollectionStatus; label: string; }; type Props = { pills: StatusPillDef[]; value: WpPostCollectionStatus; onChange: (id: WpPostCollectionStatus) => void; counts: Partial> | null; countsLoading?: boolean; }; /** * Segmented status filters with optional totals (WordPress REST `status` param). */ export function StatusCountPills({ pills, value, onChange, counts, countsLoading }: Props) { return (
{pills.map((p) => { const active = value === p.id; const n = counts?.[p.id]; const countLabel = countsLoading ? '…' : n !== undefined ? String(n) : '—'; return ( ); })}
); }