mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 00:09:39 +08:00
7e692ad585
* chore: init * chore: panel style * docs: update demo * chore: fill style * test: update snapshot * docs: update demo * chore: push * docs: update desc * chore: fix icons * chore: use shared hooks * test: update snapshot * chore: fix lint
24 lines
639 B
TypeScript
24 lines
639 B
TypeScript
import * as React from 'react';
|
|
import LeftOutlined from '@ant-design/icons/LeftOutlined';
|
|
import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
|
|
import RightOutlined from '@ant-design/icons/RightOutlined';
|
|
|
|
export default function useColumnIcons(
|
|
prefixCls: string,
|
|
rtl: boolean,
|
|
expandIcon?: React.ReactNode,
|
|
) {
|
|
let mergedExpandIcon = expandIcon;
|
|
if (!expandIcon) {
|
|
mergedExpandIcon = rtl ? <LeftOutlined /> : <RightOutlined />;
|
|
}
|
|
|
|
const loadingIcon = (
|
|
<span className={`${prefixCls}-menu-item-loading-icon`}>
|
|
<LoadingOutlined spin />
|
|
</span>
|
|
);
|
|
|
|
return [mergedExpandIcon, loadingIcon];
|
|
}
|