ant-design/components/button/demo/_semantic.tsx
二货爱吃白萝卜 7104513a84
docs: Support semantic preview (#47332)
* docs: init

* docs: semantic block

* docs: part of demo

* docs: modal

* docs: slider

* docs: space

* docs: all sementic

* docs: clean up

* chore: fix lint

* chore: clean up

* chore: update script

* test: fix test case

* test: update testcase
2024-02-05 11:45:42 +08:00

38 lines
728 B
TypeScript

import React from 'react';
import { AntDesignOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import SemanticPreview from '../../../.dumi/components/SemanticPreview';
import useLocale from '../../../.dumi/hooks/useLocale';
const locales = {
cn: {
icon: '图标元素',
},
en: {
icon: 'Icon element',
},
};
const App: React.FC = () => {
const [locale] = useLocale(locales);
return (
<SemanticPreview
semantics={[
{
name: 'icon',
desc: locale.icon,
version: '5.5.0',
},
]}
>
<Button type="primary" icon={<AntDesignOutlined />}>
Ant Design
</Button>
</SemanticPreview>
);
};
export default App;