import clsx from 'clsx'; import { BarChart, FileText, Info, Paperclip, Terminal } from 'lucide-react'; import { ContainerStatus } from '@/react/docker/containers/types'; import { Authorized } from '@/react/hooks/useUser'; import { Icon } from '@@/Icon'; import { Link } from '@@/Link'; import styles from './ContainerQuickActions.module.css'; interface QuickActionsState { showQuickActionAttach: boolean; showQuickActionExec: boolean; showQuickActionInspect: boolean; showQuickActionLogs: boolean; showQuickActionStats: boolean; } interface Props { taskId?: string; containerId?: string; nodeName: string; state: QuickActionsState; status: ContainerStatus; } export function ContainerQuickActions({ taskId, containerId, nodeName, state, status, }: Props) { if (taskId) { return ; } const isActive = [ ContainerStatus.Starting, ContainerStatus.Running, ContainerStatus.Healthy, ContainerStatus.Unhealthy, ].includes(status); return (
{state.showQuickActionLogs && ( )} {state.showQuickActionInspect && ( )} {state.showQuickActionStats && isActive && ( )} {state.showQuickActionExec && isActive && ( )} {state.showQuickActionAttach && isActive && ( )}
); } interface TaskProps { taskId: string; state: QuickActionsState; } function TaskQuickActions({ taskId, state }: TaskProps) { return (
{state.showQuickActionLogs && ( )} {state.showQuickActionInspect && ( )}
); }