11import { useState , useCallback , useRef , useEffect , type ReactNode } from "react" ;
2- import { SplitScreenHint } from "./SplitScreenHint" ;
32
43export interface TabDef {
54 id : string ;
@@ -19,9 +18,6 @@ const DEFAULT_HEIGHT = 400;
1918export function BottomPanel ( { tabs, defaultTab, onClose } : BottomPanelProps ) {
2019 const [ activeTab , setActiveTab ] = useState ( defaultTab ?? tabs [ 0 ] ?. id ?? "" ) ;
2120 const [ height , setHeight ] = useState ( DEFAULT_HEIGHT ) ;
22- const [ claudeCommand , setClaudeCommand ] = useState < string | null > ( null ) ;
23- const [ copied , setCopied ] = useState ( false ) ;
24- const [ showHint , setShowHint ] = useState ( false ) ;
2521 const dragging = useRef ( false ) ;
2622 const startY = useRef ( 0 ) ;
2723 const startHeight = useRef ( 0 ) ;
@@ -54,29 +50,6 @@ export function BottomPanel({ tabs, defaultTab, onClose }: BottomPanelProps) {
5450 } ;
5551 } , [ ] ) ;
5652
57- // Fetch claude command hint
58- useEffect ( ( ) => {
59- fetch ( "/dev/api/claude-command" )
60- . then ( ( res ) => res . ok ? res . json ( ) : null )
61- . then ( ( data ) => {
62- if ( data ?. isCloud ) {
63- setClaudeCommand ( "crayon cloud claude --continue" ) ;
64- } else if ( data ?. projectRoot ) {
65- setClaudeCommand ( `cd ${ data . projectRoot } && claude --continue` ) ;
66- }
67- } )
68- . catch ( ( ) => { } ) ;
69- } , [ ] ) ;
70-
71- const copyCommand = useCallback ( ( ) => {
72- if ( ! claudeCommand ) return ;
73- navigator . clipboard . writeText ( claudeCommand ) . then ( ( ) => {
74- setCopied ( true ) ;
75- setShowHint ( true ) ;
76- setTimeout ( ( ) => setCopied ( false ) , 1500 ) ;
77- } ) ;
78- } , [ claudeCommand ] ) ;
79-
8053 const activeContent = tabs . find ( ( t ) => t . id === activeTab ) ?. content ;
8154
8255 return (
@@ -108,25 +81,6 @@ export function BottomPanel({ tabs, defaultTab, onClose }: BottomPanelProps) {
10881
10982 < div className = "flex-1" />
11083
111- { claudeCommand && (
112- < button
113- onClick = { copyCommand }
114- className = "flex items-center gap-1.5 text-[10px] text-muted-foreground hover:text-foreground transition-colors cursor-pointer mr-2 max-w-[50%] group"
115- title = "Copy to open in your terminal"
116- >
117- < span className = "shrink-0" > Prefer your own terminal?</ span >
118- < span className = "truncate font-mono" > { claudeCommand } </ span >
119- { copied ? (
120- < span className = "text-[10px] text-emerald-600 shrink-0" > Copied!</ span >
121- ) : (
122- < svg className = "w-3 h-3 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity" viewBox = "0 0 16 16" fill = "none" stroke = "currentColor" strokeWidth = "1.5" >
123- < rect x = "5" y = "5" width = "9" height = "9" rx = "1.5" />
124- < path d = "M5 11H3.5A1.5 1.5 0 012 9.5v-7A1.5 1.5 0 013.5 1h7A1.5 1.5 0 0112 2.5V5" />
125- </ svg >
126- ) }
127- </ button >
128- ) }
129-
13084 < button
13185 onClick = { onClose }
13286 className = "text-muted-foreground hover:text-foreground text-sm px-1.5 py-0.5 cursor-pointer"
@@ -141,7 +95,6 @@ export function BottomPanel({ tabs, defaultTab, onClose }: BottomPanelProps) {
14195 { activeContent }
14296 </ div >
14397
144- { showHint && < SplitScreenHint onClose = { ( ) => setShowHint ( false ) } /> }
14598 </ div >
14699 ) ;
147100}
0 commit comments