diff --git a/frontend/src/libs/components/card/card.tsx b/frontend/src/libs/components/card/card.tsx index e7b5c8d4d..e9ef14bca 100644 --- a/frontend/src/libs/components/card/card.tsx +++ b/frontend/src/libs/components/card/card.tsx @@ -1,7 +1,7 @@ import { Button, Icon } from '#libs/components/components.js'; import { type IconColor } from '#libs/enums/enums.js'; import { getValidClassNames } from '#libs/helpers/helpers.js'; -import { useCallback } from '#libs/hooks/hooks.js'; +import { forwardRef, useCallback } from '#libs/hooks/hooks.js'; import { type IconName, type ValueOf } from '#libs/types/types.js'; import styles from './styles.module.scss'; @@ -19,18 +19,24 @@ type Properties = { onIconClick?: () => void; }; -const Card: React.FC = ({ - title, - imageUrl, - onClick, - isActive = false, - iconName, - iconRight, - iconWidth, - iconHeight, - onIconClick, - iconColor, -}) => { +const Card: React.ForwardRefRenderFunction< + HTMLDivElement | null, + Properties +> = ( + { + title, + imageUrl, + onClick, + isActive = false, + iconName, + iconRight, + iconWidth, + iconHeight, + onIconClick, + iconColor, + }, + reference, +) => { const hasNoImageOrIcon = !imageUrl && !iconName; const hasImage = Boolean(imageUrl); const hasIcon = Boolean(iconName); @@ -45,7 +51,7 @@ const Card: React.FC = ({ ); return ( -
+