mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 06:51:36 -05:00
5c63188200
[web] Add tooltips when needed on badge links in gallery search results GitOrigin-RevId: edcdcf8134698f17f607e003627a8b4123519b0b
23 lines
616 B
TypeScript
23 lines
616 B
TypeScript
import { Badge as BSBadge, BadgeProps as BSBadgeProps } from 'react-bootstrap-5'
|
|
import { MergeAndOverride } from '../../../../../../types/utils'
|
|
|
|
export type BadgeProps = MergeAndOverride<
|
|
BSBadgeProps,
|
|
{
|
|
prepend?: React.ReactNode
|
|
badgeContentRef?: React.RefObject<HTMLElement>
|
|
}
|
|
>
|
|
|
|
function Badge({ prepend, children, badgeContentRef, ...rest }: BadgeProps) {
|
|
return (
|
|
<BSBadge {...rest}>
|
|
{prepend && <span className="badge-prepend">{prepend}</span>}
|
|
<span className="badge-content" ref={badgeContentRef}>
|
|
{children}
|
|
</span>
|
|
</BSBadge>
|
|
)
|
|
}
|
|
|
|
export default Badge
|