import LinkImport from 'next/link.js';
import React from 'react'; // TODO: abstract this out to support all routers
const Link = LinkImport.default || LinkImport;
const baseClass = 'banner';
export const Banner = ({ type = 'default', alignIcon = 'right', children, className, icon, onClick, to })=>{
    const classes = [
        baseClass,
        `${baseClass}--type-${type}`,
        className && className,
        to && `${baseClass}--has-link`,
        (to || onClick) && `${baseClass}--has-action`,
        icon && `${baseClass}--has-icon`,
        icon && `${baseClass}--align-icon-${alignIcon}`
    ].filter(Boolean).join(' ');
    let RenderedType = 'div';
    if (onClick && !to) RenderedType = 'button';
    if (to) RenderedType = Link;
    return /*#__PURE__*/ React.createElement(RenderedType, {
        className: classes,
        href: to || '',
        onClick: onClick
    }, icon && alignIcon === 'left' && /*#__PURE__*/ React.createElement(React.Fragment, null, icon), /*#__PURE__*/ React.createElement("span", {
        className: `${baseClass}__content`
    }, children), icon && alignIcon === 'right' && /*#__PURE__*/ React.createElement(React.Fragment, null, icon));
};
export default Banner;

//# sourceMappingURL=index.js.map