ant-design/components/card/demo/loading.tsx
Yunus EŞ 8af7080fda
demo: card demo update (#49697)
* Update loading.tsx

Space component applied for the gaps.

Signed-off-by: Yunus EŞ <yunus@yunuses.com>

* demo: demo update

---------

Signed-off-by: Yunus EŞ <yunus@yunuses.com>
Co-authored-by: 栗嘉男 <574980606@qq.com>
2024-07-06 03:40:20 +08:00

45 lines
1.3 KiB
TypeScript

import React, { useState } from 'react';
import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons';
import { Avatar, Card, Flex, Switch } from 'antd';
const actions: React.ReactNode[] = [
<EditOutlined key="edit" />,
<SettingOutlined key="setting" />,
<EllipsisOutlined key="ellipsis" />,
];
const App: React.FC = () => {
const [loading, setLoading] = useState<boolean>(true);
return (
<Flex gap="middle" align="start" vertical>
<Switch checked={!loading} onChange={(checked) => setLoading(!checked)} />
<Card loading={loading} actions={actions} style={{ minWidth: 300 }}>
<Card.Meta
avatar={<Avatar src="https://api.dicebear.com/7.x/miniavs/svg?seed=1" />}
title="Card title"
description={
<>
<p>This is the description</p>
<p>This is the description</p>
</>
}
/>
</Card>
<Card loading={loading} actions={actions} style={{ minWidth: 300 }}>
<Card.Meta
avatar={<Avatar src="https://api.dicebear.com/7.x/miniavs/svg?seed=2" />}
title="Card title"
description={
<>
<p>This is the description</p>
<p>This is the description</p>
</>
}
/>
</Card>
</Flex>
);
};
export default App;