@kadconsulting/dry
Version:
KAD Reusable Component Library
18 lines • 842 B
JavaScript
import { jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef } from 'react';
import classnames from 'classnames';
import './Link.scss';
const Link = forwardRef(({ href, value, className, children, ...props }, ref) => {
// NEXTJS FUNCTIONALITY START
const isNextJs = process.env.NEXT_PUBLIC_APP_ENV === 'nextjs' ||
process.env.REACT_APP_APP_ENV === 'nextjs';
if (isNextJs) {
const NextLink = require('next/link').default;
return (_jsxs(NextLink, { className: classnames(className, 'dry-link'), href: href, children: [value, children] }));
}
// NEXTJS FUNCTIONALITY END
return (_jsxs("a", { href: href, ref: ref, className: classnames(className, 'dry-link'), ...props, children: [value, children] }));
});
Link.displayName = 'Link';
export default Link;
//# sourceMappingURL=Link.js.map