2023-11-09 17:15:21 +08:00
|
|
|
import React, { useState } from 'react';
|
2024-04-08 14:04:08 +08:00
|
|
|
import { Button, Space, Tooltip } from 'antd';
|
2023-07-28 17:39:38 +08:00
|
|
|
|
2023-11-09 17:15:21 +08:00
|
|
|
const App: React.FC = () => {
|
|
|
|
const [disabled, setDisabled] = useState(true);
|
2023-07-28 17:39:38 +08:00
|
|
|
|
2023-11-09 17:15:21 +08:00
|
|
|
return (
|
|
|
|
<Space>
|
|
|
|
<Button onClick={() => setDisabled(!disabled)}>{disabled ? 'Enable' : 'Disable'}</Button>
|
|
|
|
<Tooltip title={disabled ? '' : 'prompt text'}>
|
|
|
|
<span>Tooltip will show on mouse enter.</span>
|
|
|
|
</Tooltip>
|
|
|
|
</Space>
|
|
|
|
);
|
|
|
|
};
|
2023-07-28 17:39:38 +08:00
|
|
|
|
|
|
|
export default App;
|