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.
47 lines
1.2 KiB
47 lines
1.2 KiB
2 years ago
|
import React, { useState } from 'react';
|
||
|
import { EditOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons';
|
||
|
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://joeschmoe.io/api/v1/random" />}
|
||
|
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://joeschmoe.io/api/v1/random" />}
|
||
|
title="Card title"
|
||
|
description="This is the description"
|
||
|
/>
|
||
|
</Skeleton>
|
||
|
</Card>
|
||
|
</>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|