Update terminal-panel.tsx

This commit is contained in:
MacRimi
2025-11-23 23:29:49 +01:00
parent 86daedc802
commit 2b4a5d2ce7

View File

@@ -19,7 +19,7 @@ import {
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button"
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog" import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog"
import { Input } from "@/components/ui/input" import { Input } from "@/components/ui/input"
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"
import type { CheatSheetResult } from "@/lib/cheat-sheet-result" // Declare CheatSheetResult here import type { CheatSheetResult } from "@/lib/cheat-sheet-result" // Declare CheatSheetResult here
type TerminalPanelProps = { type TerminalPanelProps = {
@@ -665,19 +665,19 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
</TabsTrigger> </TabsTrigger>
))} ))}
</TabsList> </TabsList>
<div className="flex-1 relative"> {terminals.map((terminal) => (
{terminals.map((terminal) => ( <TabsContent
key={terminal.id}
value={terminal.id}
forceMount
className={`flex-1 mt-0 ${activeTerminalId === terminal.id ? "block" : "hidden"}`}
>
<div <div
key={terminal.id} ref={(el) => (containerRefs.current[terminal.id] = el)}
className={`absolute inset-0 ${activeTerminalId === terminal.id ? "block" : "hidden"}`} className="w-full h-full bg-black overflow-hidden"
> />
<div </TabsContent>
ref={(el) => (containerRefs.current[terminal.id] = el)} ))}
className="w-full h-full bg-black overflow-hidden"
/>
</div>
))}
</div>
</Tabs> </Tabs>
) : ( ) : (
<div className={`${getLayoutClass()} h-full gap-0.5 bg-zinc-800 p-0.5 w-full overflow-hidden`}> <div className={`${getLayoutClass()} h-full gap-0.5 bg-zinc-800 p-0.5 w-full overflow-hidden`}>