mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 17:19:11 +08:00
2cdf586291
* chore: fix lint * chore: fix lint * test: fix 16 * fix: lint
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons';
|
|
import React, { useState } from 'react';
|
|
import { Avatar, Card, Skeleton, Switch } from 'antd';
|
|
|
|
const { Meta } = Card;
|
|
|
|
const App: React.FC = () => {
|
|
const [loading, setLoading] = useState(true);
|
|
|
|
const onChange = (checked: boolean) => {
|
|
setLoading(!checked);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<Switch checked={!loading} onChange={onChange} />
|
|
<Card style={{ width: 300, marginTop: 16 }} loading={loading}>
|
|
<Meta
|
|
avatar={<Avatar src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1" />}
|
|
title="Card title"
|
|
description="This is the description"
|
|
/>
|
|
</Card>
|
|
<Card
|
|
style={{ width: 300, marginTop: 16 }}
|
|
actions={[
|
|
<SettingOutlined key="setting" />,
|
|
<EditOutlined key="edit" />,
|
|
<EllipsisOutlined key="ellipsis" />,
|
|
]}
|
|
>
|
|
<Skeleton loading={loading} avatar active>
|
|
<Meta
|
|
avatar={<Avatar src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2" />}
|
|
title="Card title"
|
|
description="This is the description"
|
|
/>
|
|
</Skeleton>
|
|
</Card>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|