/** * If the provided className is a string, it will be returned as is. * Otherwise, the function will call the className function with the state as the first argument. */ export function resolveClassName( className: string | ((state: State) => string | undefined) | undefined, state: State, ) { return typeof className === 'function' ? className(state) : className; }