import React from 'react';
import { useI18n } from '../../../utilities/i18nInit.js';
import { chunkArray } from '../../../utilities/chunkArray.js';
import MobileOnlyAccordionPanel from '../../mobileOnlyAccordion/MobileOnlyAccordionPanel.js';
import MobileOnlyAccordionItem from '../../mobileOnlyAccordion/MobileOnlyAccordionItem.js';
import MobileOnlyAccordionButton from '../../mobileOnlyAccordion/MobileOnlyAccordionButton.js';
import MobileOnlyAccordion from '../../mobileOnlyAccordion/index.js';
import { ListItem } from '@chakra-ui/react';
import List from '../../list/index.js';
import GridItem from '../../grid/GridItem.js';
import FooterLink from './Link.js';

var FooterSections = function (_a) {
    var config = _a.config;
    var t = useI18n().t;
    var sectionChunks = chunkArray({
        array: config.sections,
        chunkSize: 2,
    });
    return (React.createElement(React.Fragment, null, sectionChunks.map(function (sectionChunk, chunkIndex) {
        return (React.createElement(GridItem, { key: "footerGridItem-".concat(chunkIndex) },
            React.createElement(MobileOnlyAccordion, { allowMultiple: true, variant: "dark" }, sectionChunk.map(function (sectionConfig, sectionIndex) {
                return (React.createElement(MobileOnlyAccordionItem, { key: "footerSection-".concat(chunkIndex, "-").concat(sectionIndex), borderTop: "none", borderBottomWidth: "1px", borderBottomColor: "gray.700" },
                    React.createElement(MobileOnlyAccordionButton, null, sectionConfig.title[0].translationKey &&
                        t(sectionConfig.title[0].translationKey)),
                    React.createElement(MobileOnlyAccordionPanel, null,
                        React.createElement(List, { size: "sm" }, sectionConfig.items.map(function (item, itemIndex) {
                            return (React.createElement(ListItem, { key: "footerListItem-".concat(chunkIndex, "-").concat(sectionIndex, "-").concat(itemIndex) },
                                React.createElement(FooterLink, { linkInstance: item })));
                        })))));
            }))));
    })));
};

export { FooterSections as default };
//# sourceMappingURL=Sections.js.map
