mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-05-04 07:24:52 +01:00
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import * as React from "react";
|
|
import { Stack, Text, IIconStyles, Icon, TooltipHost, DirectionalHint } from "@fluentui/react";
|
|
import { toolTipLabelStackTokens } from "../SettingsRenderUtils";
|
|
|
|
export interface ToolTipLabelComponentProps {
|
|
label: string;
|
|
toolTipElement: JSX.Element;
|
|
}
|
|
|
|
const iconButtonStyles: Partial<IIconStyles> = { root: { marginBottom: -3 } };
|
|
|
|
export class ToolTipLabelComponent extends React.Component<ToolTipLabelComponentProps> {
|
|
public render(): JSX.Element {
|
|
return (
|
|
<>
|
|
<Stack horizontal verticalAlign="center" tokens={toolTipLabelStackTokens}>
|
|
{this.props.label && <Text style={{ fontWeight: 600 }}>{this.props.label}</Text>}
|
|
{this.props.toolTipElement && (
|
|
<TooltipHost
|
|
content={this.props.toolTipElement}
|
|
directionalHint={DirectionalHint.rightCenter}
|
|
calloutProps={{ gapSpace: 0 }}
|
|
styles={{ root: { display: "inline-block", float: "right" } }}
|
|
>
|
|
<Icon iconName="Info" ariaLabel="Info" styles={iconButtonStyles} />
|
|
</TooltipHost>
|
|
)}
|
|
</Stack>
|
|
</>
|
|
);
|
|
}
|
|
}
|