File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,18 @@ import { BaseLink, type LinkProps } from "@/components/Link"
4
4
import { type MatomoEventOptions , trackCustomEvent } from "@/lib/utils/matomo"
5
5
6
6
export type ButtonLinkProps = LinkProps &
7
- Omit < ButtonProps , "toId" > & {
7
+ Omit < ButtonProps , "toId" | "onClick" > & {
8
8
customEventOptions ?: MatomoEventOptions
9
9
}
10
10
11
- const ButtonLink = ( { ...props } : ButtonLinkProps ) => {
12
- return < Button as = { BaseLink } activeStyle = { { } } { ...props } />
11
+ const ButtonLink = ( { customEventOptions, ...props } : ButtonLinkProps ) => {
12
+ const handleClick = ( ) => {
13
+ customEventOptions && trackCustomEvent ( customEventOptions )
14
+ }
15
+
16
+ return (
17
+ < Button as = { BaseLink } activeStyle = { { } } { ...props } onClick = { handleClick } />
18
+ )
13
19
}
14
20
15
21
export default ButtonLink
You can’t perform that action at this time.
0 commit comments