|
1
|
import React from "react" |
|
2
|
import { Badge } from "@/components/Badge" |
|
3
|
import { Link } from "@/components/Link" |
|
4
|
import { Tooltip } from "@/components/Tooltip" |
|
5
|
|
|
6
|
export type ExpandableNoticeProps = { |
|
7
|
type?: "request" | "method" | "workflow" |
|
8
|
link: string |
|
9
|
badgeContent?: React.ReactNode |
|
10
|
badgeClassName?: string |
|
11
|
} |
|
12
|
|
|
13
|
export const ExpandableNotice = ({ |
|
14
|
type = "request", |
|
15
|
link, |
|
16
|
badgeContent = "expandable", |
|
17
|
badgeClassName, |
|
18
|
}: ExpandableNoticeProps) => { |
|
19
|
return ( |
|
20
|
<Tooltip |
|
21
|
tooltipChildren={ |
|
22
|
<> |
|
23
|
If this {type} accepts an <code>expand</code>{" "} |
|
24
|
{type === "request" ? "parameter" : "parameter or property"}, |
|
25
|
<br /> this relation can be <Link href={link}>expanded</Link> into an |
|
26
|
object. |
|
27
|
</> |
|
28
|
} |
|
29
|
clickable |
|
30
|
> |
|
31
|
<Badge variant="blue" className={badgeClassName}> |
|
32
|
{badgeContent} |
|
33
|
</Badge> |
|
34
|
</Tooltip> |
|
35
|
) |
|
36
|
} |