KeygenStep: simplify it, add a tooltip over "Next" button

This commit is contained in:
Alex Gleason
2024-02-19 14:07:18 -06:00
parent b1dc2486de
commit 5eb388bb3b
2 changed files with 19 additions and 13 deletions

View File

@ -15,13 +15,15 @@ interface ITooltip {
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
/** Text to display in the tooltip. */
text: string;
/** If disabled, it will render the children without wrapping them. */
disabled?: boolean;
}
/**
* Tooltip
*/
const Tooltip: React.FC<ITooltip> = (props) => {
const { children, text } = props;
const { children, text, disabled = false } = props;
const [isOpen, setIsOpen] = useState<boolean>(false);
@ -55,6 +57,10 @@ const Tooltip: React.FC<ITooltip> = (props) => {
hover,
]);
if (disabled) {
return children;
}
return (
<>
{React.cloneElement(children, {