rd-web/src/components/DocsLink.js
ROSHAN GARG b050c15cec
Some checks are pending
NPM Installation / build (16.x, ubuntu-latest) (push) Waiting to run
NPM Installation / build (16.x, windows-latest) (push) Waiting to run
NPM Installation / build (17.x, ubuntu-latest) (push) Waiting to run
NPM Installation / build (17.x, windows-latest) (push) Waiting to run
NPM Installation / build (18.x, ubuntu-latest) (push) Waiting to run
NPM Installation / build (18.x, windows-latest) (push) Waiting to run
rd init
2024-09-13 10:19:04 +05:30

32 lines
703 B
JavaScript

import PropTypes from 'prop-types'
import React from 'react'
import { CLink } from '@coreui/react'
const DocsLink = (props) => {
const { href, name, text, ...rest } = props
const _href = name ? `https://coreui.io/react/docs/components/${name}` : href
return (
<div className="float-end">
<CLink
{...rest}
href={_href}
rel="noreferrer noopener"
target="_blank"
className="card-header-action"
>
<small className="text-body-secondary">{text || 'docs'}</small>
</CLink>
</div>
)
}
DocsLink.propTypes = {
href: PropTypes.string,
name: PropTypes.string,
text: PropTypes.string,
}
export default React.memo(DocsLink)