File tree Expand file tree Collapse file tree 1 file changed +9
-19
lines changed Expand file tree Collapse file tree 1 file changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -20,28 +20,18 @@ export function CommandDisplay({ command }: CommandDisplayProps) {
2020 }
2121 } ;
2222
23+ const defaultColors = [
24+ "text-blue-300" ,
25+ "text-yellow-300" ,
26+ "text-green-300" ,
27+ "text-purple-300" ,
28+ ] ;
29+
2330 // Split the command into parts for syntax highlighting
2431 const parts = command . split ( " " ) . map ( ( part , index ) => {
25- if ( index === 0 )
26- return (
27- < span key = { index } className = "text-blue-300" >
28- { part }
29- </ span >
30- ) ;
31- if ( index === 1 )
32- return (
33- < span key = { index } className = "text-yellow-300" >
34- { part }
35- </ span >
36- ) ;
37- if ( index === 2 )
38- return (
39- < span key = { index } className = "text-green-300" >
40- { part }
41- </ span >
42- ) ;
32+ const color = defaultColors [ index % defaultColors . length ] ;
4333 return (
44- < span key = { index } className = "text-purple-300" >
34+ < span key = { index } className = { color } >
4535 { part }
4636 </ span >
4737 ) ;
You can’t perform that action at this time.
0 commit comments