mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 08:19:37 +08:00
66 lines
1.3 KiB
TypeScript
66 lines
1.3 KiB
TypeScript
|
import React from 'react';
|
||
|
import type { StepsProps } from 'antd';
|
||
|
import { Steps, List, Avatar } from 'antd';
|
||
|
|
||
|
const data = [
|
||
|
{
|
||
|
title: 'Ant Design Title 1',
|
||
|
current: 0,
|
||
|
},
|
||
|
{
|
||
|
title: 'Ant Design Title 2',
|
||
|
current: 1,
|
||
|
status: 'error',
|
||
|
},
|
||
|
{
|
||
|
title: 'Ant Design Title 3',
|
||
|
current: 2,
|
||
|
},
|
||
|
{
|
||
|
title: 'Ant Design Title 4',
|
||
|
current: 1,
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const items = [
|
||
|
{
|
||
|
title: 'Step 1',
|
||
|
description: 'This is a Step 1.',
|
||
|
},
|
||
|
{
|
||
|
title: 'Step 2',
|
||
|
description: 'This is a Step 2.',
|
||
|
},
|
||
|
{
|
||
|
title: 'Step 3',
|
||
|
description: 'This is a Step 3.',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const App: React.FC = () => (
|
||
|
<div>
|
||
|
<List
|
||
|
itemLayout="horizontal"
|
||
|
dataSource={data}
|
||
|
renderItem={item => (
|
||
|
<List.Item>
|
||
|
<List.Item.Meta
|
||
|
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
|
||
|
title={<a href="https://ant.design">{item.title}</a>}
|
||
|
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
|
||
|
/>
|
||
|
<Steps
|
||
|
style={{ marginTop: 8 }}
|
||
|
type="inline"
|
||
|
current={item.current}
|
||
|
status={item.status as StepsProps['status']}
|
||
|
items={items}
|
||
|
/>
|
||
|
</List.Item>
|
||
|
)}
|
||
|
/>
|
||
|
</div>
|
||
|
);
|
||
|
|
||
|
export default App;
|