/**
 * Minimal clsx-compatible class name joiner (strings, arrays, objects).
 * Local copy so the ported UI library carries no npm dependency.
 */
export default function clsx( ...args ) {
	const classes = [];

	for ( const arg of args ) {
		if ( ! arg ) {
			continue;
		}
		if ( typeof arg === 'string' || typeof arg === 'number' ) {
			classes.push( arg );
		} else if ( Array.isArray( arg ) ) {
			const inner = clsx( ...arg );
			if ( inner ) {
				classes.push( inner );
			}
		} else if ( typeof arg === 'object' ) {
			for ( const key in arg ) {
				if ( arg[ key ] ) {
					classes.push( key );
				}
			}
		}
	}

	return classes.join( ' ' );
}
