import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { useDown, useStyleConfig } from '../core';
import Menu from '../menu';
import { useHeaderContext } from './context';
/** Supporting internal component to avoid code duplication. */
function ListContent({ links = [] }) {
    const styles = useStyleConfig('Header', useHeaderContext()).services;
    return (_jsxs(_Fragment, { children: [_jsx(Menu.Item, { isTruncated: true, linkProps: { href: 'https://support.veracity.com/' }, text: "Veracity support", title: "Veracity support", ...styles.item }, "veracity-support"), _jsx(Menu.Item, { isTruncated: true, linkProps: { href: 'https://id.veracity.com/terms-of-use' }, text: "Veracity terms", title: "Veracity terms", ...styles.item }, "veracity-terms"), _jsx(Menu.Item, { isTruncated: true, linkProps: { href: 'https://services.veracity.com/PrivacyStatement' }, text: "Privacy", title: "Privacy", ...styles.item }, "privacy"), links.length > 0 &&
                links.map(({ text, url }, index) => (_jsx(Menu.Item, { isTruncated: true, linkProps: { href: url }, text: text, title: text, ...styles.item }, index)))] }));
}
/** Displays a list of services available to the user. */
export function HeaderSupport(props) {
    const { links = [], ...rest } = props;
    const styles = useStyleConfig('Header', useHeaderContext()).services;
    const isTablet = useDown('lg');
    const offsetX = isTablet ? 162 : 135;
    return (_jsx(_Fragment, { children: _jsxs(Menu, { isLazy: false, offset: [offsetX, 16], placement: "bottom-end", size: "lg", ...rest, children: [_jsx(Menu.Button, { className: "vui-app-info-trigger", color: styles.button.color, icon: "falQuestionCircle", ml: 1, size: "lg", title: "Support", ...styles.button }), _jsx(Menu.List, { maxH: 295, right: 0, w: isTablet ? 280 : 320, ...styles.list, children: _jsx(ListContent, { links: links }) })] }) }));
}
HeaderSupport.displayName = 'HeaderSupport';
export default HeaderSupport;
//# sourceMappingURL=headerSupport.js.map