@@ -4,8 +4,6 @@ import { useState, useEffect } from 'react';
44import { Copy , Check } from 'lucide-react' ;
55
66export function Terminal ( ) {
7- const [ terminalStep , setTerminalStep ] = useState ( 0 ) ;
8- const [ copied , setCopied ] = useState ( false ) ;
97 const pipCommand = [
108 'pip install verbalized-sampling'
119 ] ;
@@ -21,16 +19,9 @@ export function Terminal() {
2119 ] ;
2220
2321 const allSteps = [ ...pipCommand , '' , ...pythonCode ] ;
22+ const [ terminalStep , setTerminalStep ] = useState ( allSteps . length - 1 ) ;
23+ const [ copied , setCopied ] = useState ( false ) ;
2424
25- useEffect ( ( ) => {
26- const timer = setTimeout ( ( ) => {
27- setTerminalStep ( ( prev ) =>
28- prev < allSteps . length - 1 ? prev + 1 : prev
29- ) ;
30- } , 500 ) ;
31-
32- return ( ) => clearTimeout ( timer ) ;
33- } , [ terminalStep , allSteps ] ) ;
3425
3526 const copyToClipboard = ( ) => {
3627 navigator . clipboard . writeText ( allSteps . join ( '\n' ) ) ;
@@ -156,7 +147,6 @@ export function Terminal() {
156147 < div className = "space-y-2" >
157148 { /* Pip Install Block */ }
158149 < div className = "space-y-1" >
159- < div className = "text-xs text-gray-500 mb-1" > Installation:</ div >
160150 { pipCommand . map ( ( step , index ) => (
161151 < div
162152 key = { `pip-${ index } ` }
@@ -174,9 +164,6 @@ export function Terminal() {
174164
175165 { /* Python Code Block */ }
176166 < div className = "space-y-1" >
177- < div className = { `${ pipCommand . length + pythonCode . length > terminalStep ? 'opacity-0' : 'opacity-100' } transition-opacity duration-300 text-xs text-gray-500 mb-1` } >
178- Usage Example:
179- </ div >
180167 { pythonCode . map ( ( step , index ) => {
181168 const globalIndex = pipCommand . length + 1 + index ;
182169 return (
0 commit comments