import PropTypes from 'prop-types';

const productSupportPropTypes = {
    description: PropTypes.string,
    email: PropTypes.string,
    knowledgebaseUrl: PropTypes.string,
    phone: PropTypes.string,
    privacyUrl: PropTypes.string,
    termsUrl: PropTypes.string,
    i18n: PropTypes.shape({
        termsAndConditions: PropTypes.string,
        title: PropTypes.string,
        termsUrl: PropTypes.string,
        privacyUrl: PropTypes.string,
        support: PropTypes.string,
        email: PropTypes.string,
        description: PropTypes.string,
        phone: PropTypes.string,
        knowledgebaseUrl: PropTypes.string
    })
};

const productCustomAttributePropTypes = {
    type: PropTypes.string,
    attributeKey: PropTypes.string,
    label: PropTypes.string,
    value: PropTypes.string
};

const productRelatedContentTags = {
    name: PropTypes.string,
    group: PropTypes.arrayOf(
        PropTypes.shape({
            id: PropTypes.number,
            name: PropTypes.string,
            type: PropTypes.string,
            url: PropTypes.string
        })
    )
};

const productRelatedContentDetails = {
    tags: PropTypes.arrayOf(PropTypes.shape(productRelatedContentTags))
};

const productRelatedContentPropTypes = {
    details: PropTypes.shape(productRelatedContentDetails)
};

export const productAdditionalInfoDataPropTypes = {
    support: PropTypes.shape(productSupportPropTypes),
    relatedContent: PropTypes.shape(productRelatedContentPropTypes),
    customAttributes: PropTypes.arrayOf(PropTypes.shape(productCustomAttributePropTypes))
};
