You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
637 B
29 lines
637 B
2 years ago
|
import React, { useState } from 'react';
|
||
|
import { Alert, Spin, Switch } from 'antd';
|
||
|
|
||
|
const App: React.FC = () => {
|
||
|
const [loading, setLoading] = useState(false);
|
||
|
|
||
|
const toggle = (checked: boolean) => {
|
||
|
setLoading(checked);
|
||
|
};
|
||
|
|
||
|
return (
|
||
|
<div>
|
||
|
<Spin spinning={loading}>
|
||
|
<Alert
|
||
|
message="Alert message title"
|
||
|
description="Further details about the context of this alert."
|
||
|
type="info"
|
||
|
/>
|
||
|
</Spin>
|
||
|
<div style={{ marginTop: 16 }}>
|
||
|
Loading state:
|
||
|
<Switch checked={loading} onChange={toggle} />
|
||
|
</div>
|
||
|
</div>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|