import PropTypes from 'prop-types';
import { localePropTypes } from '../../prop-types/config';
import { FOOTER_LAYOUT_OPTIONS, FOOTER_SIZES_OPTIONS, FOOTER_LOGO_POSITION_OPTIONS, FOOTER_SOCIAL_ICON_POSITION_OPTIONS, FOOTER_NEWSLETTER_BUTTON_STYLE_OPTIONS, FOOTER_NEWSLETTER_POSITION_OPTIONS } from '../footer';

// Globals Props
export const footerSocialPropTypes = {
    items: PropTypes.arrayOf(PropTypes.shape({
        title: PropTypes.string,
        name: PropTypes.strin,
        url: PropTypes.string,
        logoSrc: PropTypes.string
    }))
};

export const footerNavigationPropTypes = {
    items: PropTypes.arrayOf(PropTypes.shape({
        label: PropTypes.string,
        url: PropTypes.string
    }))
};

export const footerMenuPropTypes = {
    items: PropTypes.arrayOf(PropTypes.shape({
        title: PropTypes.shape({
            label: PropTypes.string,
            url: PropTypes.string
        }),
        items: PropTypes.arrayOf(PropTypes.shape({
            label: PropTypes.string,
            url: PropTypes.string
        }))
    }))
};

export const footerCopyrightPropTypes = {
    text: PropTypes.string
};

export const footerFeaturesPropTypes = {
    items: PropTypes.arrayOf(PropTypes.shape({
        title: PropTypes.string,
        text: PropTypes.string,
        icon: PropTypes.string,
        link: PropTypes.string
    }))
};

export const i18nFooterSocialPropTypes = {
    followUs: PropTypes.string
};

export const i18nFooterNewsletterPropTypes = {
    newsletterTitle: PropTypes.string,
    newsletterDescription: PropTypes.string,
    newsletterButton: PropTypes.string
};

export const i18nFooterNavigationPropTypes = {
    navigationTitle: PropTypes.string
};

export const i18nFooterMenuPropTypes = {
    menuTitle: PropTypes.string
};

export const footerDataPropTypes = {
    locale: PropTypes.shape(localePropTypes),
    marketplaceName: PropTypes.string,
    logo: PropTypes.string,
    i18n: PropTypes.shape({
        ...i18nFooterSocialPropTypes,
        ...i18nFooterNewsletterPropTypes,
        ...i18nFooterNavigationPropTypes,
        ...i18nFooterMenuPropTypes
    })
};

export const footerSettingsPropTypes = {
    layout: PropTypes.oneOf(FOOTER_LAYOUT_OPTIONS.map(({ value }) => value)),
    size: PropTypes.oneOf(FOOTER_SIZES_OPTIONS.map(({ value }) => value)),
    copyright: PropTypes.string,
    navigation: PropTypes.shape(footerNavigationPropTypes),
    menu: PropTypes.shape(footerMenuPropTypes),
    displayLogo: PropTypes.bool,
    logoPosition: PropTypes.oneOf(FOOTER_LOGO_POSITION_OPTIONS.map(({ value }) => value)),
    footerBackground: PropTypes.string,
    footerText: PropTypes.string,
    bottomBarBackground: PropTypes.string,
    bottomBarText: PropTypes.string,
    displayLanguageSwitcher: PropTypes.bool,
    displaySocialMedia: PropTypes.bool,
    displayDefaultSocialIcons: PropTypes.bool,
    socials: PropTypes.shape(footerSocialPropTypes),
    socialIconColor: PropTypes.string,
    socialIconPosition: PropTypes.oneOf(FOOTER_SOCIAL_ICON_POSITION_OPTIONS.map(({ value }) => value)),
    newsletterTitle: PropTypes.string,
    newsletterText: PropTypes.string,
    newsletterButtonLabel: PropTypes.string,
    newsletterButtonLink: PropTypes.string,
    newsletterButtonStyle: PropTypes.oneOf(FOOTER_NEWSLETTER_BUTTON_STYLE_OPTIONS.map(({ value }) => value)),
    newsletterSocialPosition: PropTypes.oneOf(FOOTER_NEWSLETTER_POSITION_OPTIONS.map(({ value }) => value)),
    features: PropTypes.shape(footerFeaturesPropTypes)
};

// Footer Layouts Props
export const footerNewsletterSocialPropTypes = {};
