2023-05-13 20:15:18 +08:00
|
|
|
import React, {FC, MouseEventHandler, ReactElement} from 'react';
|
2023-05-05 23:23:34 +08:00
|
|
|
import {Button, Tooltip} from '@fluentui/react-components';
|
|
|
|
|
2023-05-13 20:15:18 +08:00
|
|
|
export const ToolTipButton: FC<{
|
2023-05-18 20:48:53 +08:00
|
|
|
text?: string | null, desc: string, icon?: ReactElement, onClick?: MouseEventHandler
|
2023-05-13 20:15:18 +08:00
|
|
|
}> = ({
|
|
|
|
text,
|
|
|
|
desc,
|
|
|
|
icon,
|
|
|
|
onClick
|
|
|
|
}) => {
|
2023-05-05 23:23:34 +08:00
|
|
|
return (
|
|
|
|
<Tooltip content={desc} showDelay={0} hideDelay={0} relationship="label">
|
2023-05-13 20:15:18 +08:00
|
|
|
<Button icon={icon} onClick={onClick}>{text}</Button>
|
2023-05-05 23:23:34 +08:00
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
};
|