@@ -14,8 +14,14 @@ import {
1414import { useThemeProps } from '@mui/material/styles' ;
1515
1616import { ButtonProps } from './Button' ;
17- import { DeleteWithUndoButton } from './DeleteWithUndoButton' ;
18- import { DeleteWithConfirmButton } from './DeleteWithConfirmButton' ;
17+ import {
18+ DeleteWithUndoButton ,
19+ DeleteWithUndoButtonProps ,
20+ } from './DeleteWithUndoButton' ;
21+ import {
22+ DeleteWithConfirmButton ,
23+ DeleteWithConfirmButtonProps ,
24+ } from './DeleteWithConfirmButton' ;
1925
2026/**
2127 * Button used to delete a single record. Added by default by the <Toolbar> of edit and show views.
@@ -95,26 +101,14 @@ export const DeleteButton = <RecordType extends RaRecord = any>(
95101 ) ;
96102} ;
97103
98- export interface DeleteButtonProps <
104+ export type DeleteButtonProps <
99105 RecordType extends RaRecord = any ,
100106 MutationOptionsError = unknown ,
101- > extends ButtonProps ,
102- SaveContextValue {
103- confirmTitle ?: React . ReactNode ;
104- confirmContent ?: React . ReactNode ;
105- confirmColor ?: 'primary' | 'warning' ;
106- icon ?: React . ReactNode ;
107- mutationMode ?: MutationMode ;
108- mutationOptions ?: UseMutationOptions <
109- RecordType ,
110- MutationOptionsError ,
111- DeleteParams < RecordType >
112- > ;
113- record ?: RecordType ;
114- redirect ?: RedirectionSideEffect ;
115- resource ?: string ;
116- successMessage ?: string ;
117- }
107+ > = SaveContextValue &
108+ (
109+ | DeleteWithUndoButtonProps < RecordType , MutationOptionsError >
110+ | DeleteWithConfirmButtonProps < RecordType , MutationOptionsError >
111+ ) ;
118112
119113const PREFIX = 'RaDeleteButton' ;
120114
0 commit comments