fix: improve dialog handling and error management in list items (#257)
* fix: improve dialog handling and error management in list items * chore: lint
This commit is contained in:
@@ -9,8 +9,8 @@ export type CloseWrapper<T> = (close: () => void) => T;
|
||||
* Information about a dialog.
|
||||
*/
|
||||
export interface DialogInfo {
|
||||
title?: JSX.Element;
|
||||
description?: JSX.Element;
|
||||
title?: string | JSX.Element;
|
||||
description?: string | JSX.Element;
|
||||
className?: string;
|
||||
buttons?: JSX.Element | CloseWrapper<JSX.Element>;
|
||||
onClose?: () => void;
|
||||
@@ -24,7 +24,9 @@ export type ShowDialogFn = (info: DialogInfo | CloseWrapper<DialogInfo>) => void
|
||||
/**
|
||||
* Context for the dialog provider.
|
||||
*/
|
||||
export const DialogContext = createContext<ShowDialogFn>(() => {});
|
||||
export const DialogContext = createContext<ShowDialogFn>(() => {
|
||||
throw new Error('DialogContext not initialized.');
|
||||
});
|
||||
|
||||
/**
|
||||
* @returns The dialog context for showing dialogs.
|
||||
|
||||
Reference in New Issue
Block a user