overleaf/services/web/frontend/js/features/ui/components/bootstrap-5/badge.tsx
M Fahru 862fb9f2ae Merge pull request #21268 from overleaf/mf-new-gallery-search-result-badge
[web] Standardize `.badge` styling and HTML structure for both gallery-search and blog post page

GitOrigin-RevId: edfaceb61900897178654a920995e5c857fe7107
2024-10-28 09:05:55 +00:00

20 lines
510 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
}
>
function Badge({ prepend, children, ...rest }: BadgeProps) {
return (
<BSBadge {...rest}>
{prepend && <span className="badge-prepend">{prepend}</span>}
<span className="badge-content">{children}</span>
</BSBadge>
)
}
export default Badge