mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 07:58:16 -05:00
25 lines
567 B
TypeScript
25 lines
567 B
TypeScript
|
import classNames from 'classnames'
|
||
|
import type { MergeAndOverride } from '../../../../../../types/utils'
|
||
|
import Badge, { type BadgeProps } from './badge'
|
||
|
|
||
|
type BadgeLinkProps = MergeAndOverride<
|
||
|
BadgeProps,
|
||
|
{
|
||
|
href: string
|
||
|
}
|
||
|
>
|
||
|
|
||
|
function BadgeLink({ href, children, ...badgeProps }: BadgeLinkProps) {
|
||
|
const containerClass = classNames('badge-link', {
|
||
|
[`badge-link-${badgeProps.bg}`]: badgeProps.bg,
|
||
|
})
|
||
|
|
||
|
return (
|
||
|
<a className={containerClass} href={href}>
|
||
|
<Badge {...badgeProps}>{children}</Badge>
|
||
|
</a>
|
||
|
)
|
||
|
}
|
||
|
|
||
|
export default BadgeLink
|