import { Trans, useLingui } from "@lingui/react/macro"; import type { Bot, ComputerStatus } from "@rakazo/contracts"; import { Maximize2 } from "lucide-react"; import type { ReactNode } from "react"; import { ComputersUnavailableHint, computersAreUnavailable, } from "../../components/ComputersUnavailableHint"; import { AgentCursor } from "../../components/computer/AgentCursor"; import { computerLabel, computerPlaceholder, DesktopKindEmptyState, screenIframeSandbox, } from "./computer-screen"; import { WorkspaceFilesView } from "./workspace-files"; /** The bot's screen in the side panel: a live, non-interactive preview that opens full window. */ export function ComputerPanelPreview({ active, computer, computerOpen, booting, embeddedScreenUrl, computerScreenError, sandboxProvider, onOpen, }: { active: Bot; computer: ComputerStatus | null; computerOpen: boolean; booting: boolean; embeddedScreenUrl: string | null; computerScreenError: ReactNode; sandboxProvider: string | undefined; onOpen: () => void; }) { const { t } = useLingui(); // Opening the panel never starts the computer, so a resting one shows its Open action outright. const resting = !booting && computer?.state !== "running" && computer?.state !== "booting" && !computersAreUnavailable(sandboxProvider); return ( <>
{t`${active.name}'s screen`}