/**
 * Accepts the falsy results of `cond && 'class'` guards. `cond` is often a
 * ReactNode, so numbers and empty strings reach here too — anything that is
 * not a non-empty string is dropped.
 */
export type ClassValue = string | number | boolean | null | undefined;

/** Joins truthy class names. Intentionally tiny — no object/array syntax. */
export function cx(...parts: ClassValue[]): string {
  return parts.filter((part): part is string => typeof part === 'string' && part !== '').join(' ');
}
