Skip to content

Commit 756104b

Browse files
committed
feat: add addBtnTooltip prop to DynamicDataTableHeader for customizable add button tooltip
1 parent 3376c4b commit 756104b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Shared/Components/DynamicDataTable/DynamicDataTableHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const DynamicDataTableHeader = <K extends string, CustomStateType = Recor
2727
headers,
2828
rows,
2929
sortingConfig,
30+
addBtnTooltip,
3031
onRowAdd,
3132
readOnly,
3233
isAdditionNotAllowed,
@@ -89,12 +90,11 @@ export const DynamicDataTableHeader = <K extends string, CustomStateType = Recor
8990
{shouldRenderAddRowButton && (
9091
<Button
9192
dataTestId="data-table-add-row-button"
92-
ariaLabel="Add"
93+
ariaLabel={addBtnTooltip}
9394
onClick={onRowAdd}
9495
icon={<ICAdd />}
9596
variant={ButtonVariantType.borderLess}
9697
size={ComponentSizeType.xs}
97-
showAriaLabelInTippy={false}
9898
/>
9999
)}
100100
{key === lastHeaderKey && headerComponent}

src/Shared/Components/DynamicDataTable/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
169169
isDeletionNotAllowed?: boolean
170170
/** When true, data add or update is disabled. */
171171
readOnly?: boolean
172+
/** Tooltip for add button.
173+
* @default 'Add'
174+
*/
175+
addBtnTooltip?: string
172176
/** Function to handle the addition of a new row to the table. */
173177
onRowAdd: () => void
174178
/**
@@ -233,6 +237,7 @@ export interface DynamicDataTableHeaderProps<K extends string, CustomStateType =
233237
| 'rows'
234238
| 'headerComponent'
235239
| 'sortingConfig'
240+
| 'addBtnTooltip'
236241
| 'onRowAdd'
237242
| 'readOnly'
238243
| 'isAdditionNotAllowed'

0 commit comments

Comments
 (0)