import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cn } from "../../../../lib/utils";
export function AgentBrowserClaimBanner({ variant = "inline", isClaimedByCurrentSession, isClaimedByAnotherBrowser, isPendingBrowserCaptureWait, isPending, onRelease, onClaim, }) {
    if (!isClaimedByCurrentSession && !isClaimedByAnotherBrowser) {
        return null;
    }
    if (isPendingBrowserCaptureWait) {
        return null;
    }
    const label = isClaimedByCurrentSession
        ? "Attached to this browser"
        : isClaimedByAnotherBrowser
            ? "Attached in another browser"
            : "No browser attached";
    const description = isClaimedByCurrentSession
        ? "This browser will handle page screenshot and DOM capture requests for the agent."
        : isClaimedByAnotherBrowser
            ? "Capture requests will stay with the other browser until you take over control here."
            : "A page capture request is waiting for a browser attachment. Attach this browser to continue.";
    return (_jsx("div", { className: cn("border-feedback-blue bg-feedback-blue-light text-feedback-blue rounded border p-3 text-[11px]", variant === "fixed" ? "mx-3 mt-3 mb-2 shrink-0" : "m-3", isClaimedByCurrentSession && "border-feedback-blue"), children: _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "font-semibold", children: label }), _jsx("div", { className: "text-feedback-blue mt-1", children: description })] }), _jsx("div", { className: "flex shrink-0 items-center gap-2", children: isClaimedByCurrentSession ? (_jsx("button", { type: "button", className: "border-feedback-blue badge-pad text-feedback-blue rounded border bg-white text-[11px] font-medium disabled:cursor-not-allowed disabled:opacity-60", disabled: isPending, onClick: onRelease, children: "Release" })) : (_jsx("button", { type: "button", className: "border-feedback-blue badge-pad text-feedback-blue rounded border bg-white text-[11px] font-medium disabled:cursor-not-allowed disabled:opacity-60", disabled: isPending, onClick: () => onClaim(isClaimedByAnotherBrowser), children: isClaimedByAnotherBrowser
                            ? "Take over browser control"
                            : "Attach to this browser" })) })] }) }));
}
//# sourceMappingURL=AgentBrowserClaimBanner.js.map