Skip to content

Commit 8015ff2

Browse files
committed
feat: adicionar toast de sucesso/erro no botão Reiniciar
1 parent e1ed792 commit 8015ff2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/pages/instance/DashboardInstance/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CircleUser, MessageCircle, RefreshCw, UsersRound } from "lucide-react";
33
import { useEffect, useMemo, useState } from "react";
44
import { useTranslation } from "react-i18next";
55
import QRCode from "react-qr-code";
6+
import { toast } from "react-toastify";
67

78
import { InstanceStatus } from "@/components/instance-status";
89
import { InstanceToken } from "@/components/instance-token";
@@ -46,8 +47,10 @@ function DashboardInstance() {
4647
try {
4748
await restart(instanceName);
4849
await reloadInstance();
50+
toast.success(t("instance.dashboard.toast.restart.success"));
4951
} catch (error) {
5052
console.error("Error:", error);
53+
toast.error(t("instance.dashboard.toast.restart.error"));
5154
}
5255
};
5356

src/translate/languages/pt-BR.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@
131131
"restart": "Reiniciar",
132132
"disconnect": "Desconectar"
133133
},
134+
"toast": {
135+
"restart": {
136+
"success": "Instância reiniciada com sucesso",
137+
"error": "Erro ao reiniciar instância"
138+
}
139+
},
134140
"alert": "Para conectar, escaneie o QR Code com o WhatsApp",
135141
"contacts": "Contatos",
136142
"chats": "Chats",

0 commit comments

Comments
 (0)