Skip to content

Commit f054b9b

Browse files
committed
Merge branch 'develop' of github.com:EvolutionAPI/evolution-manager-v2 into develop
2 parents c25a36b + 6ac2c4a commit f054b9b

File tree

8 files changed

+486
-11
lines changed

8 files changed

+486
-11
lines changed

package-lock.json

Lines changed: 425 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"@radix-ui/react-slot": "^1.1.0",
6464
"@radix-ui/react-switch": "^1.1.0",
6565
"@radix-ui/react-tabs": "^1.1.0",
66+
"@radix-ui/react-tooltip": "^1.2.8",
6667
"@tanstack/react-query": "^5.52.1",
6768
"@tanstack/react-table": "^8.20.1",
6869
"axios": "^1.7.2",

src/components/ui/tooltip.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import * as Tooltip from "@radix-ui/react-tooltip";
2+
import { ReactNode } from "react";
3+
4+
interface TooltipWrapperProps {
5+
content: ReactNode; // o texto que vai aparecer no tooltip
6+
children: ReactNode; // o trigger (qualquer elemento)
7+
side?: "top" | "right" | "bottom" | "left"; // posição opcional
8+
}
9+
10+
export function TooltipWrapper({ content, children, side = "top" }: TooltipWrapperProps) {
11+
return (
12+
<Tooltip.Provider delayDuration={200}>
13+
<Tooltip.Root>
14+
<Tooltip.Trigger asChild>
15+
{children}
16+
</Tooltip.Trigger>
17+
<Tooltip.Portal>
18+
<Tooltip.Content
19+
side={side}
20+
className="
21+
rounded px-3 py-1.5 text-sm z-50 border shadow-lg
22+
bg-gray-100 text-gray-900 border-gray-300
23+
dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700
24+
"
25+
>
26+
{content}
27+
<Tooltip.Arrow className="fill-gray-100 dark:fill-gray-800" width={18} height={9} />
28+
</Tooltip.Content>
29+
</Tooltip.Portal>
30+
</Tooltip.Root>
31+
</Tooltip.Provider>
32+
);
33+
}

src/pages/Dashboard/index.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { useManageInstance } from "@/lib/queries/instance/manageInstance";
1919
import { Instance } from "@/types/evolution.types";
2020

2121
import { NewInstance } from "./NewInstance";
22+
import { TooltipWrapper } from "@/components/ui/tooltip";
2223

2324
function Dashboard() {
2425
const { t } = useTranslation();
@@ -114,15 +115,20 @@ function Dashboard() {
114115
</div>
115116
<main className="grid gap-6 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
116117
{filteredInstances.length > 0 &&
117-
Array.isArray(instances) &&
118-
instances.map((instance: Instance) => (
118+
Array.isArray(filteredInstances) ? (
119+
filteredInstances.map((instance: Instance) => (
119120
<Card key={instance.id}>
120121
<CardHeader>
121122
<Link to={`/manager/instance/${instance.id}/dashboard`} className="flex w-full flex-row items-center justify-between gap-4">
122-
<h3 className="text-wrap font-semibold">{instance.name}</h3>
123-
<Button variant="ghost" size="icon">
124-
<Cog className="card-icon" size="20" />
125-
</Button>
123+
<TooltipWrapper content={instance.name} side="top">
124+
<h3 className="text-wrap font-semibold truncate">{instance.name}</h3>
125+
</TooltipWrapper>
126+
127+
<TooltipWrapper content={t("dashboard.settings")} side="top">
128+
<Button variant="ghost" size="icon">
129+
<Cog className="card-icon" size="20" />
130+
</Button>
131+
</TooltipWrapper>
126132
</Link>
127133
</CardHeader>
128134
<CardContent className="flex-1 space-y-6">
@@ -161,7 +167,9 @@ function Dashboard() {
161167
</Button>
162168
</CardFooter>
163169
</Card>
164-
))}
170+
))) :(
171+
<p>{t("dashboard.instancesNotFound")}</p>
172+
)}
165173
</main>
166174

167175
{!!deleteConfirmation && (

src/translate/languages/en-US.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"dashboard": {
33
"title": "Instances",
44
"search": "Search",
5-
"status": "Status"
5+
"status": "Status",
6+
"settings": "Settings",
7+
"instancesNotFound": "No instances found"
68
},
79
"button": {
810
"delete": "Delete",

src/translate/languages/es-ES.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"dashboard": {
33
"title": "Instancias",
44
"search": "Buscar",
5-
"status": "Estado"
5+
"status": "Estado",
6+
"settings": "Configuraciones",
7+
"instancesNotFound": "No se encontraron instancias"
68
},
79
"button": {
810
"delete": "Eliminar",

src/translate/languages/fr-FR.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"dashboard": {
33
"title": "Instances",
44
"search": "Rechercher",
5-
"status": "Statut"
5+
"status": "Statut",
6+
"settings": "Paramètres",
7+
"instancesNotFound": "Aucune instance trouvée"
68
},
79
"button": {
810
"delete": "Supprimer",

src/translate/languages/pt-BR.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"dashboard": {
33
"title": "Instâncias",
44
"search": "Pesquisar",
5-
"status": "Status"
5+
"status": "Status",
6+
"settings": "Configurações",
7+
"instancesNotFound": "Nenhuma instância encontrada"
68
},
79
"button": {
810
"delete": "Excluir",

0 commit comments

Comments
 (0)