/**
 * Distinguishes the two empty states a filtered list can land in, so callers
 * show the right recovery: an empty collection => "add your first item" CTA,
 * a non-empty collection filtered to nothing => "no matches, reset the filter".
 * Pure, DOM-free, unit-tested. Caller invokes this only when the *filtered*
 * list is empty.
 *
 * @param isLoading   data still loading
 * @param totalCount  number of items BEFORE the active search/filter is applied
 */
export type SearchEmptyState = "loading" | "empty" | "no-results"

export function resolveSearchEmptyState(
  isLoading: boolean,
  totalCount: number,
): SearchEmptyState {
  if (isLoading) return "loading"
  return totalCount === 0 ? "empty" : "no-results"
}
