ant-design/components/badge/demo/colorful-with-count-debug.tsx
二货爱吃白萝卜 2cdf586291
chore: fix lint (#43873)
* chore: fix lint

* chore: fix lint

* test: fix 16

* fix: lint
2023-07-28 16:17:43 +08:00

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;