diff --git a/src/components/Caption.jsx b/src/components/Caption.jsx deleted file mode 100644 index eb2f4b9b1..000000000 --- a/src/components/Caption.jsx +++ /dev/null @@ -1,18 +0,0 @@ -import PropTypes from 'prop-types'; - -import {getBEMClassName} from 'utils'; - -const Caption = ({children, component = 'caption', ...props}) => { - const Component = `${component}`; - return ( - - {children} - - ); -}; - -Caption.propTypes = { - children: PropTypes.node.isRequired, -}; - -export default Caption; diff --git a/src/components/Caption.tsx b/src/components/Caption.tsx new file mode 100644 index 000000000..e4759cf34 --- /dev/null +++ b/src/components/Caption.tsx @@ -0,0 +1,17 @@ +import {getBEMClassName} from '@/utils'; + +export type CaptionProps = { + children?: React.ReactNode; + component?: T; +} & React.ComponentPropsWithoutRef; + +const Caption: React.FC = ({children, component, ...props}) => { + const Component = component || 'caption'; + return ( + + {children} + + ); +}; + +export default Caption;