mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-12 22:29:35 +08:00
40 lines
821 B
TypeScript
40 lines
821 B
TypeScript
import React from 'react'
|
|
import withDefaults from '../utils/with-defaults'
|
|
|
|
interface Props {
|
|
width?: string
|
|
}
|
|
|
|
const defaultProps = {
|
|
width: '1.25em',
|
|
}
|
|
|
|
export type SelectIconProps = Props & typeof defaultProps
|
|
|
|
const SelectIcon: React.FC<SelectIconProps> = ({ width }) => {
|
|
return (
|
|
<svg
|
|
viewBox="0 0 24 24"
|
|
width={width}
|
|
height={width}
|
|
strokeWidth="1"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
fill="none"
|
|
shapeRendering="geometricPrecision">
|
|
<path d="M6 9l6 6 6-6" />
|
|
<style jsx>{`
|
|
svg {
|
|
color: inherit;
|
|
stroke: currentColor;
|
|
transition: all 200ms ease;
|
|
}
|
|
`}</style>
|
|
</svg>
|
|
)
|
|
}
|
|
|
|
const MemoSelectIcon = React.memo(SelectIcon)
|
|
|
|
export default withDefaults(MemoSelectIcon, defaultProps)
|