"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const core_1 = require("../core");
const footerColumn_1 = __importDefault(require("./footerColumn"));
const footerRow_1 = __importDefault(require("./footerRow"));
/** Organizes sections with links into a single column. Different width per breakpoint. */
const FooterColumns = (0, core_1.vui)(props => {
    const { columns } = props;
    const downXs = (0, core_1.useDown)(460);
    const downMd = (0, core_1.useDown)('md');
    if (!columns)
        return null;
    if (downXs) {
        return ((0, jsx_runtime_1.jsx)(footerRow_1.default, { children: (0, jsx_runtime_1.jsx)(footerColumn_1.default, { flex: '1 1 auto', sections: columns.flat(), textAlign: 'center' }, 'evenColumns') }));
    }
    if (downMd) {
        const columnsEven = columns.filter((_, index) => index % 2 === 0).flat();
        const columnsOdd = columns.filter((_, index) => index % 2 === 1).flat();
        return ((0, jsx_runtime_1.jsxs)(footerRow_1.default, { children: [(0, jsx_runtime_1.jsx)(footerColumn_1.default, { sections: columnsEven }, 'evenColumns'), (0, jsx_runtime_1.jsx)(footerColumn_1.default, { sections: columnsOdd }, 'oddColumns')] }));
    }
    return ((0, jsx_runtime_1.jsx)(footerRow_1.default, { children: columns.map((sections, index) => ((0, jsx_runtime_1.jsx)(footerColumn_1.default, { sections: sections }, index))) }));
});
FooterColumns.displayName = 'Footer Mobile Column';
exports.default = FooterColumns;
//# sourceMappingURL=footerColumns.js.map