/**
 * Utility function to compute the appropriate set of class names from all the
 * breakpoint prop values provided.
 */
const getBreakpointClassnames = function getBreakpointClassnames(breakpoints) {
  const classNames = Object.entries(breakpoints).map(([name, value]) => {
    if (value === true) {
      return [`columns-${name}`];
    }
    const {
      columns,
      offset
    } = !value || typeof value !== 'object' ? {
      columns: value
    } : value;
    if (!columns) {
      return [];
    }
    return [`columns-${name}-${columns}`, `offset-${name}-${offset}`];
  }).flat();
  return classNames.length > 0 ? classNames : 'autolayout';
};
export default getBreakpointClassnames;