mirror of
https://github.com/hexastack/hexabot
synced 2025-02-22 20:38:32 +00:00
fix(frontend): update confirm dialog first prop type
This commit is contained in:
parent
268dd6812b
commit
5197e57efa
@ -80,7 +80,7 @@ export const Categories = () => {
|
||||
{
|
||||
label: ActionColumnLabel.Delete,
|
||||
action: async ({ id }) => {
|
||||
const isConfirmed = await dialogs.confirm(<ConfirmDialogBody />);
|
||||
const isConfirmed = await dialogs.confirm(ConfirmDialogBody);
|
||||
|
||||
if (isConfirmed) {
|
||||
deleteCategory(id);
|
||||
@ -160,10 +160,10 @@ export const Categories = () => {
|
||||
color="error"
|
||||
variant="contained"
|
||||
onClick={async () => {
|
||||
const isConfirmed = await dialogs.confirm(
|
||||
<ConfirmDialogBody />,
|
||||
{ mode: "selection", count: selectedCategories.length },
|
||||
);
|
||||
const isConfirmed = await dialogs.confirm(ConfirmDialogBody, {
|
||||
mode: "selection",
|
||||
count: selectedCategories.length,
|
||||
});
|
||||
|
||||
if (isConfirmed) {
|
||||
deleteCategories(selectedCategories);
|
||||
|
@ -38,7 +38,7 @@ export const useDialogs = (): DialogHook => {
|
||||
ConfirmDialog,
|
||||
{
|
||||
...rest,
|
||||
msg,
|
||||
msg: React.createElement(msg),
|
||||
},
|
||||
{
|
||||
mode,
|
||||
|
@ -114,7 +114,7 @@ export interface OpenConfirmDialog {
|
||||
* @param options Additional options for the dialog.
|
||||
* @returns A promise that resolves to true if the user confirms, false if the user cancels.
|
||||
*/
|
||||
(msg: React.ReactNode, options?: ConfirmOptions): Promise<boolean>;
|
||||
(msg: React.ComponentType, options?: ConfirmOptions): Promise<boolean>;
|
||||
}
|
||||
|
||||
export interface DialogHook {
|
||||
|
Loading…
Reference in New Issue
Block a user