import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import Box from '../box';
import { useStyleConfig, v, vui } from '../core';
import { cs, isJsx } from '../utils';
import { useFooterContext } from './context';
import FooterHeading from './footerHeading';
import FooterLink from './footerLink';
/** Section includes a heading and a set of links. */
export const FooterSection = vui((props, ref) => {
    const { children, className, heading, links, ...rest } = props;
    const styles = useStyleConfig('Footer', useFooterContext());
    return (_jsxs(Box, { className: cs('vui-footerSection', className), column: true, ref: ref, ...styles.section, ...rest, children: [isJsx(heading) ? heading : _jsx(FooterHeading, { text: heading }), children ??
                (isJsx(links) ? (links) : (_jsx(v.ul, { children: links?.map(({ text, url }, index) => (_jsx(v.li, { children: _jsx(FooterLink, { href: url, text: text }) }, index))) })))] }));
});
FooterSection.displayName = 'FooterSection';
export default FooterSection;
//# sourceMappingURL=footerSection.js.map