import { __assign } from "tslib";
// @ts-nocheck
import './ListLinks.css';
import React from 'react';
import { IconArrowRight } from '../../icons/IconArrowRight/IconArrowRight';
import { IconSoon } from '../../icons/IconSoon/IconSoon';
import { cn } from '../../utils/bem';
import { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';
import { Button } from '../Button/Button';
var cnListLinks = cn('ListLinks');
export var ListLinks = forwardRefWithAs(function (props, ref) {
    var items = props.items, getLabel = props.getLabel, getPath = props.getPath;
    var linkAttrs = function (item) {
        var pathLink = getPath === null || getPath === void 0 ? void 0 : getPath(item);
        var targetBlank = item.targetBlank;
        if (pathLink && !targetBlank) {
            return {
                isLink: true,
                to: pathLink,
                iconRight: IconArrowRight
            };
        }
        if (pathLink && targetBlank) {
            return {
                as: 'a',
                href: pathLink,
                iconRight: IconArrowRight,
                target: '_blank'
            };
        }
        return {
            iconRight: IconSoon,
            disabled: true
        };
    };
    return (React.createElement("div", { className: cnListLinks() }, items.map(function (item) { return (React.createElement("div", { className: cnListLinks('Item'), key: item.id },
        React.createElement(Button, __assign({ view: "link-primary", label: getLabel(item), width: 'full' }, linkAttrs(item))))); })));
});
