var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from 'react';
import { Link } from 'react-router-dom';
import { Typography, Link as MuiLink, makeStyles, useTheme } from '@material-ui/core';
const useStyles = makeStyles((theme) => ({
    root: {
        textDecoration: 'none',
        '& > * + *': {
            marginLeft: theme.spacing(2)
        }
    },
    link: {
        textDecoration: 'none',
        fontWeight: 700
    }
}));
export const FluentLink = (props) => {
    const { icon, alt, label, children, activeClassName, to, linkColor } = props, otherProps = __rest(props, ["icon", "alt", "label", "children", "activeClassName", "to", "linkColor"]);
    const theme = useTheme();
    const classes = useStyles();
    return to && to.substring(0, 4) !== 'http' ? (React.createElement(Link, { to: to, activeClassName: activeClassName, className: classes.link, style: {
            color: linkColor === 'primary'
                ? theme.palette.primary.main
                : theme.palette.secondary.main
        } }, children)) : (React.createElement(Typography, { component: "div", className: classes.root }, React.createElement(MuiLink, Object.assign({}, otherProps, { href: to, color: linkColor, variant: "body1", style: { textDecoration: 'none' } }), children)));
};
//# sourceMappingURL=FluentLink.js.map