diff --git a/apps/dokploy/components/dashboard/application/logs/show.tsx b/apps/dokploy/components/dashboard/application/logs/show.tsx index dc895085..a73b99d2 100644 --- a/apps/dokploy/components/dashboard/application/logs/show.tsx +++ b/apps/dokploy/components/dashboard/application/logs/show.tsx @@ -31,7 +31,7 @@ export const DockerLogs = dynamic( }, ); -const badgeStateColor = (state: string) => { +export const badgeStateColor = (state: string) => { switch (state) { case "running": return "green"; diff --git a/apps/dokploy/components/dashboard/compose/logs/show-stack.tsx b/apps/dokploy/components/dashboard/compose/logs/show-stack.tsx index 901aeaaf..d166f933 100644 --- a/apps/dokploy/components/dashboard/compose/logs/show-stack.tsx +++ b/apps/dokploy/components/dashboard/compose/logs/show-stack.tsx @@ -1,3 +1,4 @@ +import { badgeStateColor } from "@/components/dashboard/application/logs/show"; import { Badge } from "@/components/ui/badge"; import { Card, @@ -36,20 +37,7 @@ interface Props { serverId?: string; } -const badgeStateColor = (state: string) => { - switch (state) { - case "running": - return "green"; - case "exited": - case "shutdown": - return "red"; - case "accepted": - case "created": - return "blue"; - default: - return "default"; - } -}; +badgeStateColor; export const ShowDockerLogsStack = ({ appName, serverId }: Props) => { const [option, setOption] = useState<"swarm" | "native">("native"); diff --git a/apps/dokploy/components/dashboard/compose/logs/show.tsx b/apps/dokploy/components/dashboard/compose/logs/show.tsx index 56aceeb2..4530e0dd 100644 --- a/apps/dokploy/components/dashboard/compose/logs/show.tsx +++ b/apps/dokploy/components/dashboard/compose/logs/show.tsx @@ -1,3 +1,4 @@ +import { badgeStateColor } from "@/components/dashboard/application/logs/show"; import { Badge } from "@/components/ui/badge"; import { Card, @@ -36,21 +37,6 @@ interface Props { appType: "stack" | "docker-compose"; } -const badgeStateColor = (state: string) => { - switch (state) { - case "running": - return "green"; - case "exited": - case "shutdown": - return "red"; - case "accepted": - case "created": - return "blue"; - default: - return "default"; - } -}; - export const ShowDockerLogsCompose = ({ appName, appType,