import CodeEditor from "@uiw/react-textarea-code-editor"; import EasyModal, { type InnerModalProps } from "ez-modal-react"; import { useState } from "react"; import { Alert } from "react-bootstrap"; import Modal from "react-bootstrap/Modal"; import { Button, Loading } from "src/components"; import { useProxyHostLogs } from "src/hooks"; import { T } from "src/locale"; const showHostLogsModal = (id: number) => { EasyModal.show(HostLogsModal, { id }); }; interface Props extends InnerModalProps { id: number; } const HostLogsModal = EasyModal.create(({ id, visible, remove }: Props) => { const [logType, setLogType] = useState<"access" | "error">("access"); const { data, isLoading, error } = useProxyHostLogs(id, logType); return ( {!isLoading && error && ( {error?.message || "Unknown error"} )}
{isLoading ? ( ) : (
)}
); }); export { showHostLogsModal };