@shakthillc/components
Version:
React generic components for shakthi products
32 lines (27 loc) • 668 B
JavaScript
import React from "react";
import style from "./Link.module.css";
import { PropTypes } from "prop-types";
var Link = function Link(_ref) {
var children = _ref.children,
link = _ref.link,
target = _ref.target,
isDisabled = _ref.isDisabled;
return React.createElement(
"a",
{
href: link,
target: target,
className: isDisabled === "true" ? style["anchor-disabled"] : style["anchor"]
},
children
);
};
Link.defaultProps = {
target: "_self"
};
Link.propTypes = {
target: PropTypes.oneOf(["_blank", "_self", "_parent", "_top"]),
href: PropTypes.string,
isDisabled: PropTypes.bool
};
export default Link;