import{r as l,j as e}from"./vendor-markdown-CkTmV-He.js";import{u as a,F as o}from"./index-CKH_4wKU.js";import{T as c}from"./TerminalView-DCNigu2G.js";import"./vendor-react-DAm3T7tM.js";import"./vendor-analytics-Bg9iiwD1.js";import"./vendor-diff-R4VRD87i.js";import"./vendor-xterm-D1D2FVe3.js";function u(){const t=a(r=>r.terminalCwd),[i,s]=l.useState(!1);return e.jsxs("div",{className:"h-full bg-cc-bg overflow-y-auto",children:[e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-8 py-6 sm:py-10 h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-6 shrink-0",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-cc-fg",children:"Terminal"}),e.jsx("p",{className:"mt-1 text-sm text-cc-muted",children:"Run shell commands in a project folder without leaving the Companion."})]}),e.jsx("button",{type:"button",onClick:()=>s(!0),className:"px-3 py-2 rounded-lg text-sm font-medium bg-cc-primary hover:bg-cc-primary-hover text-white transition-colors cursor-pointer whitespace-nowrap",children:t?"Change Folder":"Choose Folder"})]}),e.jsx("div",{className:"flex-1 min-h-[420px]",children:t?e.jsx(c,{cwd:t,embedded:!0}):e.jsx("div",{className:"h-full bg-cc-card border border-cc-border rounded-xl p-6 sm:p-8 flex items-center justify-center text-center",children:e.jsxs("div",{className:"max-w-md",children:[e.jsx("h2",{className:"text-lg font-semibold text-cc-fg mb-2",children:"No terminal started yet"}),e.jsx("p",{className:"text-sm text-cc-muted",children:"Choose a folder to start a terminal session. You can switch folders anytime."})]})})})]}),i&&e.jsx(o,{initialPath:t||"",onSelect:r=>{a.getState().openTerminal(r),window.location.hash="#/terminal",s(!1)},onClose:()=>s(!1)})]})}export{u as TerminalPage};
