UNPKG

@clayui/shared

Version:
41 lines (40 loc) 786 B
import ClayButton from "@clayui/button"; import ClayLink from "@clayui/link"; import React from "react"; const LinkOrButton = React.forwardRef( ({ buttonDisplayType, buttonType, href, linkDisplayType, onClick, ...otherProps }, ref) => { if (href) { return /* @__PURE__ */ React.createElement( ClayLink, { ...otherProps, displayType: linkDisplayType, href, onClick, ref } ); } return /* @__PURE__ */ React.createElement( ClayButton, { ...otherProps, displayType: buttonDisplayType, onClick, ref, type: buttonType } ); } ); LinkOrButton.displayName = "ClayLinkOrButton"; export { LinkOrButton };