import { LogViewer } from '@cameleer/design-system'; import type { LogEntry } from '@cameleer/design-system'; import { useStartupLogs } from '../api/queries/logs'; import type { Deployment } from '../api/queries/admin/apps'; import styles from './StartupLogPanel.module.css'; interface StartupLogPanelProps { deployment: Deployment; appSlug: string; envSlug: string; } export function StartupLogPanel({ deployment, appSlug, envSlug }: StartupLogPanelProps) { const isStarting = deployment.status === 'STARTING'; const isFailed = deployment.status === 'FAILED'; const { data } = useStartupLogs(appSlug, envSlug, deployment.createdAt, isStarting); const entries = data?.data ?? []; if (entries.length === 0 && !isStarting) return null; return (
Startup Logs {isStarting && ( <> ● live polling every 3s )} {isFailed && ( stopped )}
{entries.length} lines
{entries.length > 0 ? ( ) : (
Waiting for container output...
)}
); }