import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { api } from "@/utils/api"; import dynamic from "next/dynamic"; import type React from "react"; import { useEffect, useState } from "react"; export const DockerLogsId = dynamic( () => import("@/components/dashboard/docker/logs/docker-logs-id").then( (e) => e.DockerLogsId, ), { ssr: false, }, ); interface Props { appName: string; children?: React.ReactNode; } export const ShowModalLogs = ({ appName, children }: Props) => { const { data } = api.docker.getContainersByAppLabel.useQuery( { appName, }, { enabled: !!appName, }, ); const [containerId, setContainerId] = useState(); useEffect(() => { if (data && data?.length > 0) { setContainerId(data[0]?.containerId); } }, [data]); return ( e.preventDefault()} > {children} View Logs View the logs for {appName}
); };