import PropTypes from "prop-types";
import avatarAriaProps from "./Avatar.ariaPropTypes";
import tagAttributeProps, {
  tagAttributePropsName
} from "../../propTypes/htmlAttributes.propTypes";
import customClassProps, {
  customClassPropName
} from "../../propTypes/customClassName.propTypes";
import automationProps, {
  automationPropsName
} from "../../propTypes/automation.propTypes";
import defaultCustomIds from "./Avatar.customIds";
import constantProps from "./Avatar.constantProps";

export default {
  size: PropTypes.oneOf([
    constantProps.size.small,
    constantProps.size.medium,
    constantProps.size.large,
    constantProps.size.xLarge
  ]),
  color: PropTypes.oneOf([
    constantProps.color.default,
    constantProps.color.primary,
    constantProps.color.secondary
  ]),
  shape: PropTypes.oneOf([
    constantProps.shape.circle,
    constantProps.shape.square
  ]),
  text: PropTypes.string,
  floatingLayer: PropTypes.bool,
  photoUrl: PropTypes.string,
  floatingLayerText: PropTypes.string,
  floatingLayerAlign: PropTypes.oneOf([
    constantProps.floatingLayerAlign.bottom,
    constantProps.floatingLayerAlign.top,
    constantProps.floatingLayerAlign.right,
    constantProps.floatingLayerAlign.left
  ]),
  onLoad: PropTypes.func,
  onError: PropTypes.func,

  ...avatarAriaProps,
  ...customClassProps,
  ...automationProps,
  ...tagAttributeProps
};
// textdecoration
export const defaultProps = {
  size: constantProps.size.medium,
  // color: constantProps.color.default,
  shape: constantProps.shape.circle,
  floatingLayerAlign: constantProps.floatingLayerAlign.top,
  [automationPropsName]: defaultCustomIds,
  [customClassPropName]: {},
  [tagAttributePropsName]: {}
};

export const propsDescription = {
  size: "To define the dimensions",
  color: "To define the colors border",
  shape: "To define the skin view of avatar",
  text: "To show the text inside the component",
  photoUrl: "Show the img",
  floatingLayerText: "",
  floatingLayer: "",
  floatingLayerAlign: "To align floating layer",
  onLoad: "It will be fire while img load",
  onError: "It will be fire while img if getting error"
};
