import { jsx as _jsx } from "react/jsx-runtime";
import Text from "../text";
import { useGetLang, useLink } from "../../hooks/locale";
import { containsSubPage } from "./util";
const Link = ({ pathname, matcher = containsSubPage, children }) => {
    const lang = useGetLang();
    const to = useLink();
    return (_jsx(Text.F1, { as: "a", href: `/dex/${lang}/${pathname}`, onClick: (e) => {
            e.preventDefault();
            to(pathname);
        }, className: matcher(pathname) ? "active" : "", children: children }));
};
export default Link;
//# sourceMappingURL=link.js.map