"use client"; import { memo } from "react"; import { PanelRoot, PanelBody } from "./panel-primitives"; import { PassthroughTerminal } from "./passthrough-terminal"; import { ShellTerminal } from "./shell-terminal"; import { useAppStore } from "@/components/state-provider"; import { useIsTaskArchived, ArchivedPanelPlaceholder } from "./task-archived-context"; import { useEnvironmentId } from "@/hooks/use-environment-session-id"; type TerminalPanelProps = { panelId: string; params: Record; }; export const TerminalPanel = memo(function TerminalPanel({ params }: TerminalPanelProps) { const terminalId = params.terminalId as string; const type = (params.type as string) ?? "shell"; const processId = params.processId as string | undefined; const environmentId = useEnvironmentId(); const devOutput = useAppStore((state) => processId ? (state.processes.outputsByProcessId[processId] ?? "") : "", ); const devProcess = useAppStore((state) => processId ? state.processes.processesById[processId] : undefined, ); const isStopping = devProcess?.status === "stopping"; const isArchived = useIsTaskArchived(); if (isArchived) return ; if (type === "dev-server" && processId) { return ( ); } return ( ); });