'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/**
 * OperationLogsIconButton — the subtle discoverability affordance for
 * the OperationLogsDrawer. Renders as a tiny info icon tucked next to
 * the Deploy / Publish buttons. Never shouts, never dominates the row.
 *
 * Visual states:
 *   - idle       → muted info dot, 60% opacity → 100% on hover
 *   - running    → animated loader dot, primary tint
 *   - failed     → destructive tint to match the parent button's red border
 *
 * Click opens the slide-over drawer for this operation.
 */
import { Info, TriangleAlert } from 'lucide-react';
import { cn } from '../../../lib/utils.js';
/**
 * Tiny info-icon affordance that opens the OperationLogsDrawer.
 *
 * Deliberately NON-spinning in the running state — the parent action button
 * (Deploy, Publish) already owns the motion indicator for "operation in
 * progress". Duplicating the spinner here would add visual noise without
 * adding information. Instead, running is communicated via a coloured
 * pulsing dot overlay on a static Info glyph, which the eye reads as
 * "there's something live here" without competing with the button's
 * primary spinner.
 */
export function OperationLogsIconButton({ state, onClick, className, label = 'View operation logs', }) {
    const Icon = state === 'failed' ? TriangleAlert : Info;
    return (_jsxs("button", { type: "button", onClick: onClick, "aria-label": label, title: label, className: cn('relative inline-flex size-6 cursor-pointer items-center justify-center rounded-md transition-colors', state === 'idle' && 'text-muted-foreground/70 hover:text-foreground hover:bg-accent', state === 'running' && 'text-primary hover:bg-primary/10 hover:text-primary', state === 'failed' && 'text-destructive hover:bg-destructive/10 hover:text-destructive', state === 'success' && 'text-emerald-500 hover:bg-emerald-500/10 hover:text-emerald-600', className), children: [_jsx(Icon, { className: "size-3.5" }), state === 'running' ? (_jsx("span", { "aria-hidden": "true", className: "bg-primary absolute end-0.5 top-0.5 size-1.5 animate-pulse rounded-full" })) : null] }));
}
