Skip to content

Commit

Permalink
🏷️ [#445] Convert Caption component to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Mar 6, 2025
1 parent c885000 commit 69013f4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/components/Caption.jsx

This file was deleted.

17 changes: 17 additions & 0 deletions src/components/Caption.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {getBEMClassName} from '@/utils';

export type CaptionProps<T extends React.ElementType = 'caption'> = {
children?: React.ReactNode;
component?: T;
} & React.ComponentPropsWithoutRef<T>;

const Caption: React.FC<CaptionProps> = ({children, component, ...props}) => {
const Component = component || 'caption';
return (
<Component className={getBEMClassName('caption')} {...props}>
{children}
</Component>
);
};

export default Caption;

0 comments on commit 69013f4

Please sign in to comment.