











/**
* 表格排序图标
* - default:上下三角均为未激活色
* - asc:上三角高亮(升序)
* - desc:下三角高亮(降序)
*/
export type SortIconStatus = 'default' | 'asc' | 'desc'interface SortIconProps extends SVGProps<SVGSVGElement> {
status?: SortIconStatus
/** 未激活三角颜色 */
inactiveColor?: string
/** 激活三角颜色 */
activeColor?: string
}export const SortIcon = ({
status = 'default',
inactiveColor = '#A3A3A3',
activeColor = '#333333',
className = '',
'aria-label': ariaLabel,
...props
}: SortIconProps) => {
const upColor = status === 'asc' ? activeColor : inactiveColor
const downColor = status === 'desc' ? activeColor : inactiveColorreturn (
<svg
{...props}
aria-hidden={ariaLabel ? undefined : true}
aria-label={ariaLabel}
className={className}
width="6"
height="10"
viewBox="0 0 6 10"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M3 0L6 4H0L3 0Z" fill={upColor} />
<path d="M3 10L0 6H6L3 10Z" fill={downColor} />
</svg>
)
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。