mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 04:48:51 +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,
|
label: ActionColumnLabel.Delete,
|
||||||
action: async ({ id }) => {
|
action: async ({ id }) => {
|
||||||
const isConfirmed = await dialogs.confirm(<ConfirmDialogBody />);
|
const isConfirmed = await dialogs.confirm(ConfirmDialogBody);
|
||||||
|
|
||||||
if (isConfirmed) {
|
if (isConfirmed) {
|
||||||
deleteCategory(id);
|
deleteCategory(id);
|
||||||
@ -160,10 +160,10 @@ export const Categories = () => {
|
|||||||
color="error"
|
color="error"
|
||||||
variant="contained"
|
variant="contained"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const isConfirmed = await dialogs.confirm(
|
const isConfirmed = await dialogs.confirm(ConfirmDialogBody, {
|
||||||
<ConfirmDialogBody />,
|
mode: "selection",
|
||||||
{ mode: "selection", count: selectedCategories.length },
|
count: selectedCategories.length,
|
||||||
);
|
});
|
||||||
|
|
||||||
if (isConfirmed) {
|
if (isConfirmed) {
|
||||||
deleteCategories(selectedCategories);
|
deleteCategories(selectedCategories);
|
||||||
|
@ -38,7 +38,7 @@ export const useDialogs = (): DialogHook => {
|
|||||||
ConfirmDialog,
|
ConfirmDialog,
|
||||||
{
|
{
|
||||||
...rest,
|
...rest,
|
||||||
msg,
|
msg: React.createElement(msg),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
mode,
|
mode,
|
||||||
|
@ -114,7 +114,7 @@ export interface OpenConfirmDialog {
|
|||||||
* @param options Additional options for the dialog.
|
* @param options Additional options for the dialog.
|
||||||
* @returns A promise that resolves to true if the user confirms, false if the user cancels.
|
* @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 {
|
export interface DialogHook {
|
||||||
|
Loading…
Reference in New Issue
Block a user