import { useMemo } from 'react';
import { getFallbackProps, sizeFormatting } from '../utils/index.js';

var useInnerProps = function useInnerProps(props, initialInnerProps) {
  return useMemo(function () {
    var width = props.width,
      height = props.height;
    if (!width || !height) {
      return getFallbackProps(props, initialInnerProps);
    }
    var innerProps = {
      wrapperWidth: sizeFormatting(width),
      wrapperHeight: sizeFormatting(height),
      svgWidth: height,
      svgHeight: width,
      color: initialInnerProps.color
    };
    return getFallbackProps(props, innerProps);
  }, [props.width, props.height, props.view, props.size]);
};

export { useInnerProps };
