import PropTypes from "prop-types";
import uploadButtonAriaProps from "./UploadButton.ariaPropTypes";
import tagAttributeProps, {
  tagAttributePropsName
} from "../../propTypes/htmlAttributes.propTypes";
import customClassProps, {
  customClassPropName
} from "../../propTypes/customClassName.propTypes";
import automationProps, {
  automationPropsName
} from "../../propTypes/automation.propTypes";

import constantProps from "./UploadButton.constantProps";

import defaultCustomIds from "./UploadButton.customIds";

export default {
  size: PropTypes.oneOf([
    constantProps.size.small,
    constantProps.size.medium,
    constantProps.size.large,
    constantProps.size.xLarge,
    constantProps.size.stretch
  ]),
  shape: PropTypes.oneOf([
    constantProps.shape.square,
    constantProps.shape.oval,
    constantProps.shape.circle,
    constantProps.shape.default
  ]),
  color: PropTypes.oneOf([
    constantProps.color.primary,
    constantProps.color.secondary,
    constantProps.color.success,
    constantProps.color.danger
  ]),
  variant: PropTypes.oneOf([
    constantProps.variant.contained,
    constantProps.variant.outlined,
    constantProps.variant.text
  ]),
  text: PropTypes.string,
  startIcon: PropTypes.node,
  endIcon: PropTypes.node,
  disabled: PropTypes.bool,
  customId: PropTypes.object,
  accept: PropTypes.string,
  multiple: PropTypes.bool,
  eleRef: PropTypes.object,
  onHandleFile: PropTypes.func,

  ...uploadButtonAriaProps,
  ...customClassProps,
  ...automationProps,
  ...tagAttributeProps
};

export const defaultProps = {
  size: constantProps.size.small,
  shape: constantProps.shape.square,
  color: constantProps.color.primary,
  variant: constantProps.variant.contained,
  customId: { uploadButton: "uploadButton" },
  [automationPropsName]: defaultCustomIds,
  [customClassPropName]: {},
  [tagAttributePropsName]: {}
};

export const propsDescription = {
  size: "Size of the upload button view",
  shape: "To declare the upload button shape",
  color: "To declare the upload button color",
  variant: "To declare the upload button variant",
  text: "To show content for the element",
  startIcon: "To show any icon before text",
  endIcon: "To show any icon after text",
  disabled: "To disabled upload button behaviour",
  customId: "To put custom attribute",
  accept: "To control the upload file based on the extend",
  multiple: "To give the option for multiple files upload",
  eleRef: "To get the element",
  onHandleFile: "To use the event handler for file upload"
};
