ant-design/components/spin/demo/delayAndDebounce.tsx
2024-07-07 17:44:21 +08:00

24 lines
581 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import { Alert, Flex, Spin, Switch } from 'antd';
const App: React.FC = () => {
const [loading, setLoading] = React.useState<boolean>(false);
return (
<Flex gap="middle" vertical>
<Spin spinning={loading} delay={500}>
<Alert
type="info"
message="Alert message title"
description="Further details about the context of this alert."
/>
</Spin>
<p>
Loading state
<Switch checked={loading} onChange={setLoading} />
</p>
</Flex>
);
};
export default App;