overleaf/services/web/frontend/js/features/ui/components/bootstrap-5/badge.tsx
ilkin-overleaf fe7de51827 Merge pull request #18338 from overleaf/ii-bs5-split-badges-and-tags
[web] Split badges and tags

GitOrigin-RevId: fce5a93672f431ff74c2b63a67e249f5f7e7fecd
2024-05-28 08:04:05 +00:00

20 lines
514 B
TypeScript

import { Badge as BSBadge } from 'react-bootstrap-5'
import { MergeAndOverride } from '../../../../../../types/utils'
type BadgeProps = MergeAndOverride<
React.ComponentProps<typeof BSBadge>,
{
prepend?: React.ReactNode
}
>
function Badge({ prepend, children, closeBtnProps, ...rest }: BadgeProps) {
return (
<BSBadge {...rest}>
{prepend && <span className="badge-prepend">{prepend}</span>}
<span className="badge-content">{children}</span>
</BSBadge>
)
}
export default Badge