Skip to content

Commit ef4a613

Browse files
authored
Table action custom component click (#571)
* Add onCustomComponentClick handler * v5.0.50
1 parent a813362 commit ef4a613

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netdata/netdata-ui",
3-
"version": "5.0.49",
3+
"version": "5.0.50",
44
"description": "netdata UI kit",
55
"main": "dist/index.js",
66
"module": "dist/es6/index.js",

src/components/table/components/action.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React, { useState, useMemo } from "react"
2-
32
import Tooltip from "@/components/drops/tooltip"
43
import Flex from "@/components/templates/flex"
5-
64
import { ConfirmationDialog } from "@/components/confirmation-dialog"
75
import { Button, IconButton } from "@/components/button"
86

@@ -30,6 +28,7 @@ const Action = ({
3028
flavour = "borderless",
3129
CustomUIAction,
3230
CustomComponent,
31+
onCustomComponentClick,
3332
label,
3433
TooltipComponent = Tooltip,
3534
ref,
@@ -42,6 +41,9 @@ const Action = ({
4241
e.stopPropagation()
4342
if (confirmation || CustomUIAction) {
4443
setConfirmationOpen(true)
44+
if (typeof onCustomComponentClick === "function") {
45+
onCustomComponentClick(currentRow?.original || selectedRows)
46+
}
4547
return
4648
}
4749
handleAction()

0 commit comments

Comments
 (0)