Skip to content

Commit 6251bda

Browse files
committed
Improve DeleteWithConfirmButton resource name
1 parent dad7916 commit 6251bda

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
useTranslate,
1414
RedirectionSideEffect,
1515
useGetRecordRepresentation,
16-
useGetResourceLabel,
1716
useResourceTranslation,
1817
} from 'ra-core';
1918

@@ -66,7 +65,6 @@ export const DeleteWithConfirmButton = <RecordType extends RaRecord = any>(
6665
resource,
6766
successMessage,
6867
});
69-
const getResourceLabel = useGetResourceLabel();
7068
const getRecordRepresentation = useGetRecordRepresentation(resource);
7169
let recordRepresentation = getRecordRepresentation(record);
7270
const resourceName = translate(`resources.${resource}.forcedCaseName`, {
@@ -87,7 +85,7 @@ export const DeleteWithConfirmButton = <RecordType extends RaRecord = any>(
8785
resourceI18nKey: `resources.${resource}.action.delete`,
8886
baseI18nKey: 'ra.action.delete',
8987
options: {
90-
name: getResourceLabel(resource, 1),
88+
name: resourceName,
9189
recordRepresentation,
9290
},
9391
userText: labelProp,

0 commit comments

Comments
 (0)