mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 13:08:41 +08:00
2cdf586291
* chore: fix lint * chore: fix lint * test: fix 16 * fix: lint
52 lines
906 B
TypeScript
52 lines
906 B
TypeScript
import React from 'react';
|
|
import { Badge, Space } from 'antd';
|
|
|
|
const colors = [
|
|
'pink',
|
|
'red',
|
|
'yellow',
|
|
'orange',
|
|
'cyan',
|
|
'green',
|
|
'blue',
|
|
'purple',
|
|
'geekblue',
|
|
'magenta',
|
|
'volcano',
|
|
'gold',
|
|
'lime',
|
|
];
|
|
|
|
const AvatarItem = ({ color }: { color: string }) => (
|
|
<div
|
|
style={{
|
|
width: 90,
|
|
height: 90,
|
|
lineHeight: '90px',
|
|
background: '#ccc',
|
|
textAlign: 'center',
|
|
}}
|
|
>
|
|
{color}
|
|
</div>
|
|
);
|
|
|
|
const App: React.FC = () => (
|
|
<>
|
|
<Space wrap size={['large', 'middle']}>
|
|
{colors.map((color) => (
|
|
<Badge color={color} count={44} key={color}>
|
|
<AvatarItem color={color} />
|
|
</Badge>
|
|
))}
|
|
</Space>
|
|
<Space wrap size={['large', 'middle']}>
|
|
{colors.map((color) => (
|
|
<Badge status="processing" color={color} text="loading" key={color} />
|
|
))}
|
|
</Space>
|
|
</>
|
|
);
|
|
|
|
export default App;
|