import { badgeStateColor } from "@/components/dashboard/application/logs/show"; import { Badge } from "@/components/ui/badge"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { api } from "@/utils/api"; import { Loader2 } from "lucide-react"; import dynamic from "next/dynamic"; import { useEffect, useState } from "react"; export const DockerLogs = dynamic( () => import("@/components/dashboard/docker/logs/docker-logs-id").then( (e) => e.DockerLogsId, ), { ssr: false, }, ); interface Props { appName: string; serverId?: string; appType: "stack" | "docker-compose"; } export const ShowDockerLogsCompose = ({ appName, appType, serverId, }: Props) => { const { data, isLoading } = api.docker.getContainersByAppNameMatch.useQuery( { appName, appType, serverId, }, { enabled: !!appName, }, ); const [containerId, setContainerId] = useState(); useEffect(() => { if (data && data?.length > 0) { setContainerId(data[0]?.containerId); } }, [data]); return ( Logs Watch the logs of the application in real time ); };