Files
react/components/tree/tree-status-icon.tsx
witt 7facec3849 feat(scaleable): add scaleable props to each component (#531)
* feat(scaleable): add scaleable props to each component

* chore(scaleable): update the exported type

* feat: apply scaleable to components

chore: remove with-default

test: improve testcase for scaleable

chore: resolve test warning

ci: upgrade nodejs to latest lts

docs: fix type error in document site

* docs: update documents to be compatible with scaleable

chore: fix build errors

* chore: remove all size-related attributes

docs: improve guide document

* docs: add scaleable documentation

test: update snapshots

chore: remove unused

* feat: add scaleable to grid components

* docs: improve docs

* test: update snapshots

* fix(grid): fix basic component props
2021-08-13 17:10:57 +08:00

51 lines
1.0 KiB
TypeScript

import React from 'react'
import useTheme from '../use-theme'
export interface TreeStatusIconProps {
color?: string
width?: number
height?: number
active?: boolean
}
const defaultProps = {
width: 12,
height: 12,
active: false,
}
const TreeStatusIcon: React.FC<TreeStatusIconProps> = ({
color,
width,
height,
active,
}: TreeStatusIconProps & typeof defaultProps) => {
const theme = useTheme()
return (
<svg
viewBox="0 0 24 24"
width={width}
height={height}
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
fill="none"
shapeRendering="geometricPrecision">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
{!active && <path d="M12 8v8" />}
<path d="M8 12h8" />
<style jsx>{`
svg {
color: ${color || theme.palette.accents_8};
}
`}</style>
</svg>
)
}
TreeStatusIcon.defaultProps = defaultProps
TreeStatusIcon.displayName = 'GeistTreeStatusIcon'
export default TreeStatusIcon