Raw
1 import React from "react"
2 import { Badge } from "@/components/Badge"
3 import { Tooltip } from "@/components/Tooltip"
4
5 export type DeprecatedNoticeProps = {
6 description?: string
7 tooltipTextClassName?: string
8 badgeClassName?: string
9 badgeContent?: React.ReactNode
10 }
11
12 export const DeprecatedNotice = ({
13 description,
14 tooltipTextClassName,
15 badgeClassName,
16 badgeContent = `Deprecated`,
17 }: DeprecatedNoticeProps) => {
18 return (
19 <Tooltip
20 tooltipChildren={
21 <span className={tooltipTextClassName}>
22 {description ||
23 "This feature is deprecated and may be removed in future releases."}
24 </span>
25 }
26 clickable
27 >
28 <Badge variant="neutral" className={badgeClassName}>
29 {badgeContent}
30 </Badge>
31 </Tooltip>
32 )
33 }