ant-design/.dumi/theme/common/DirectionIcon.tsx
afc163 c21e948f14
docs: fix Icon warning (#47290)
* docs: fix Icon warning

* Update components/modal/interface.ts

Signed-off-by: afc163 <afc163@gmail.com>

* Apply suggestions from code review

Signed-off-by: afc163 <afc163@gmail.com>

---------

Signed-off-by: afc163 <afc163@gmail.com>
2024-02-02 11:17:28 +08:00

21 lines
832 B
TypeScript

import Icon from '@ant-design/icons';
import React from 'react';
import type { DirectionType } from 'antd/es/config-provider';
const ltrD =
'M448 64l512 0 0 128-128 0 0 768-128 0 0-768-128 0 0 768-128 0 0-448c-123.712 0-224-100.288-224-224s100.288-224 224-224zM64 448l256 224-256 224z';
const rtlD =
'M256 64l512 0 0 128-128 0 0 768-128 0 0-768-128 0 0 768-128 0 0-448c-123.712 0-224-100.288-224-224s100.288-224 224-224zM960 896l-256-224 256-224z';
const DirectionSvg = ({ direction }: any) => (
<svg viewBox="0 0 1024 1024" fill="currentColor">
<path d={direction === 'ltr' ? ltrD : rtlD} />
</svg>
);
const DirectionIcon: React.FC<{ direction: DirectionType; className?: string }> = (props) => (
<Icon {...props} component={() => <DirectionSvg direction={props.direction} />} />
);
export default DirectionIcon;