diff --git a/package/client/resource/interface/alert.ts b/package/client/resource/interface/alert.ts index a9afc2c..e75c927 100644 --- a/package/client/resource/interface/alert.ts +++ b/package/client/resource/interface/alert.ts @@ -3,6 +3,10 @@ interface AlertDialogProps { content: string; centered?: boolean; cancel?: boolean; + labels?: { + cancel?: string; + confirm?: string; + }; } type alertDialog = (data: AlertDialogProps) => Promise<'cancel' | 'confirm'>; diff --git a/resource/interface/client/alert.lua b/resource/interface/client/alert.lua index e9b2cae..3543ba9 100644 --- a/resource/interface/client/alert.lua +++ b/resource/interface/client/alert.lua @@ -5,6 +5,7 @@ local alert = nil ---@field content string; ---@field centered? boolean?; ---@field cancel? boolean?; +---@field labels? {cancel?: string, confirm?: string} ---@param data AlertDialogProps ---@return 'cancel' | 'confirm' | nil diff --git a/web/src/features/dev/debug/alert.ts b/web/src/features/dev/debug/alert.ts index 67a042c..8f98586 100644 --- a/web/src/features/dev/debug/alert.ts +++ b/web/src/features/dev/debug/alert.ts @@ -10,6 +10,10 @@ export const debugAlert = () => { content: 'General kenobi \n Markdown works', centered: true, cancel: true, + labels: { + confirm: 'Ok', + cancel: 'Not ok', + }, }, }, ]); diff --git a/web/src/features/dialog/AlertDialog.tsx b/web/src/features/dialog/AlertDialog.tsx index f07ef9d..5cf03a6 100644 --- a/web/src/features/dialog/AlertDialog.tsx +++ b/web/src/features/dialog/AlertDialog.tsx @@ -19,6 +19,10 @@ export interface AlertProps { content: string; centered?: boolean; cancel?: boolean; + labels?: { + cancel?: string; + confirm?: string; + }; } const AlertDialog: React.FC = () => { @@ -65,11 +69,11 @@ const AlertDialog: React.FC = () => { {dialogData.cancel && ( )}