@@ -6,10 +6,14 @@ import {
6
6
showWarningIfFirstOccurence ,
7
7
} from "src/common/warnings" ;
8
8
import { ContentCardProps } from "../.." ;
9
+ import { EMPTY_OBJECT } from "src/common/utils" ;
9
10
10
11
export interface ContentCardActionsProps {
11
12
buttonsPosition ?: "left" | "right" ;
12
13
clickableCard ?: ContentCardProps [ "clickableCard" ] ;
14
+ classes ?: {
15
+ cardActions ?: string ;
16
+ } ;
13
17
children :
14
18
| React . ReactElement < ButtonProps >
15
19
| Array < React . ReactElement < ButtonProps > > ;
@@ -34,7 +38,14 @@ const ContentCardActions = forwardRef<HTMLDivElement, ContentCardActionsProps>(
34
38
props : ContentCardActionsProps ,
35
39
ref
36
40
) : JSX . Element | null {
37
- const { buttonsPosition, clickableCard, children } = props ;
41
+ const {
42
+ buttonsPosition,
43
+ clickableCard,
44
+ children,
45
+ classes = EMPTY_OBJECT ,
46
+ } = props ;
47
+
48
+ const { cardActions } : ContentCardActionsProps [ "classes" ] = classes ;
38
49
39
50
/**
40
51
* (masoudmanson):
@@ -72,12 +83,16 @@ const ContentCardActions = forwardRef<HTMLDivElement, ContentCardActionsProps>(
72
83
}
73
84
74
85
return (
75
- < StyledCardActions ref = { ref } buttonsPosition = { buttonsPosition } >
86
+ < StyledCardActions
87
+ ref = { ref }
88
+ buttonsPosition = { buttonsPosition }
89
+ className = { cardActions }
90
+ >
76
91
{ [
77
92
React . cloneElement (
78
93
clickableCardButton as React . ReactElement < ButtonProps > ,
79
94
{
80
- component : "a " ,
95
+ component : "div " ,
81
96
...( clickableCardButton ?. props as ButtonProps ) ,
82
97
}
83
98
) ,
@@ -87,7 +102,11 @@ const ContentCardActions = forwardRef<HTMLDivElement, ContentCardActionsProps>(
87
102
}
88
103
89
104
return (
90
- < StyledCardActions ref = { ref } buttonsPosition = { buttonsPosition } >
105
+ < StyledCardActions
106
+ ref = { ref }
107
+ buttonsPosition = { buttonsPosition }
108
+ className = { cardActions }
109
+ >
91
110
{ validChildren }
92
111
</ StyledCardActions >
93
112
) ;
0 commit comments