mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-29 04:35:32 +08:00
24 lines
605 B
TypeScript
24 lines
605 B
TypeScript
import React from 'react'
|
|
|
|
interface Props {
|
|
active?: boolean
|
|
}
|
|
|
|
const CollapseIcon: React.FC<Props> = ({ active }) => {
|
|
return (
|
|
<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"
|
|
strokeLinejoin="round" fill="none" shapeRendering="geometricPrecision" style={{ color: 'currentColor' }}>
|
|
<path d="M6 9l6 6 6-6" />
|
|
|
|
<style jsx>{`
|
|
svg {
|
|
transition: transform 200ms ease;
|
|
transform: rotateZ(${active ? '-180deg' : '0'});
|
|
}
|
|
`}</style>
|
|
</svg>
|
|
)
|
|
}
|
|
|
|
export default CollapseIcon
|