Repository URL to install this package:
|
Version:
2.8.0-studio-release ▾
|
import React from 'react'
import { LinkProps } from './typings'
import { LinkElement } from './styled'
/**
* rendering a children, by default it renders the text
*/
function renderChildren(props: LinkProps) {
return props.children || props.text || 'Link'
}
/**
* rendering the Link
*/
function renderLink(props: LinkProps) {
const {
className,
target,
urlBase,
children,
dataQa,
...remainingProps
} = props
return (
<LinkElement className={className} target={target} urlBase={urlBase} {...remainingProps}>
{children}
</LinkElement>
)
}
export { renderLink, renderChildren }