forked from Prompt-Hash-Stellar/prompt-hash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLabelHeading.tsx
More file actions
47 lines (44 loc) · 981 Bytes
/
Copy pathLabelHeading.tsx
File metadata and controls
47 lines (44 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Icon, Tooltip } from "@stellar/design-system";
export const LabelHeading = ({
children,
size,
labelSuffix,
infoText,
infoLink,
}: {
children: React.ReactNode;
size: "sm" | "md" | "lg";
labelSuffix?: string | React.ReactNode;
infoText?: string | React.ReactNode;
infoLink?: string;
}) => (
<div className="Label__wrapper">
<div className={`Label Label--${size}`}>
{children}
{labelSuffix ? (
<span className="Label__suffix">({labelSuffix})</span>
) : null}
</div>
{infoLink ? (
<a
href={infoLink}
className="Label__infoButton"
rel="noreferrer noopener"
target="_blank"
>
<Icon.InfoCircle />
</a>
) : null}
{infoText ? (
<Tooltip
triggerEl={
<div className="Label__infoButton" role="button">
<Icon.InfoCircle />
</div>
}
>
{infoText}
</Tooltip>
) : null}
</div>
);