mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-22 22:48:29 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
24 lines
676 B
TypeScript
24 lines
676 B
TypeScript
import React, { useState } from 'react';
|
|
import { ClockCircleOutlined } from '@ant-design/icons';
|
|
import { Badge, Space, Switch } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [show, setShow] = useState(true);
|
|
|
|
return (
|
|
<Space>
|
|
<Switch checked={show} onChange={() => setShow(!show)} />
|
|
<Badge count={show ? 11 : 0} showZero color="#faad14" />
|
|
<Badge count={show ? 25 : 0} />
|
|
<Badge count={show ? <ClockCircleOutlined style={{ color: '#f5222d' }} /> : 0} />
|
|
<Badge
|
|
className="site-badge-count-109"
|
|
count={show ? 109 : 0}
|
|
style={{ backgroundColor: '#52c41a' }}
|
|
/>
|
|
</Space>
|
|
);
|
|
};
|
|
|
|
export default App;
|