mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
32 lines
676 B
TypeScript
32 lines
676 B
TypeScript
|
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);
|
|||
|
};
|
|||
|
const container = (
|
|||
|
<Alert
|
|||
|
message="Alert message title"
|
|||
|
description="Further details about the context of this alert."
|
|||
|
type="info"
|
|||
|
/>
|
|||
|
);
|
|||
|
|
|||
|
return (
|
|||
|
<div>
|
|||
|
<Spin spinning={loading} delay={500}>
|
|||
|
{container}
|
|||
|
</Spin>
|
|||
|
<div style={{ marginTop: 16 }}>
|
|||
|
Loading state:
|
|||
|
<Switch checked={loading} onChange={toggle} />
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
);
|
|||
|
};
|
|||
|
|
|||
|
export default App;
|