Skip to content

Commit ba28dc0

Browse files
committed
[docs] Add examples of callback props
1 parent cdc1c39 commit ba28dc0

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src-docs/src/views/tables/actions/actions.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,14 @@ export default () => {
183183
} else {
184184
let actions: Array<DefaultItemAction<User>> = [
185185
{
186-
name: 'Elastic.co',
187-
description: 'Go to elastic.co',
186+
name: 'User profile',
187+
description: ({ firstName, lastName }) =>
188+
`Visit ${firstName} ${lastName}'s profile`,
188189
icon: 'editorLink',
189190
color: 'primary',
190191
type: 'icon',
191-
href: 'https://elastic.co',
192-
target: '_blank',
192+
href: ({ id }) => `${window.location.href}?id=${id}`,
193+
target: '_self',
193194
'data-test-subj': 'action-outboundlink',
194195
},
195196
];
@@ -205,13 +206,14 @@ export default () => {
205206
},
206207
{
207208
name: (user: User) => (user.id ? 'Delete' : 'Remove'),
208-
description: 'Delete this user',
209+
description: ({ firstName, lastName }) =>
210+
`Delete ${firstName} ${lastName}`,
209211
icon: 'trash',
210212
color: 'danger',
211213
type: 'icon',
212214
onClick: deleteUser,
213215
isPrimary: true,
214-
'data-test-subj': 'action-delete',
216+
'data-test-subj': ({ id }) => `action-delete-${id}`,
215217
},
216218
{
217219
name: 'Edit',

0 commit comments

Comments
 (0)