mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-29 04:35:32 +08:00
34 lines
752 B
TypeScript
34 lines
752 B
TypeScript
import React from 'react'
|
|
import withDefaults from '../utils/with-defaults'
|
|
import useTheme from '../styles/use-theme'
|
|
|
|
interface Props {
|
|
className?: string
|
|
}
|
|
|
|
const defaultProps = {
|
|
className: '',
|
|
}
|
|
|
|
export type RadioDescriptionProps = Props & typeof defaultProps & React.HTMLAttributes<any>
|
|
|
|
const RadioDescription: React.FC<React.PropsWithChildren<RadioDescriptionProps>> = React.memo(({
|
|
className, children, ...props
|
|
}) => {
|
|
const theme = useTheme()
|
|
|
|
return (
|
|
<span className={className} {...props}>
|
|
{children}
|
|
<style jsx>{`
|
|
span {
|
|
color: ${theme.palette.accents_3};
|
|
font-size: .875rem;
|
|
}
|
|
`}</style>
|
|
</span>
|
|
)
|
|
})
|
|
|
|
export default withDefaults(RadioDescription, defaultProps)
|