File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 2929 gap : var (--stratakit-space-x2 );
3030 margin : var (--stratakit-space-x1 );
3131 padding : var (--stratakit-space-x1 ) 0 var (--stratakit-space-x05 );
32+ font-family : var (--stratakit-font-family-mono );
3233 }
3334 .message + .message {
3435 border-top : var (--stratakit-ext-border-border ) solid
3536 var (--stratakit-color-border-neutral-muted );
3637 }
38+ .no-icon {
39+ /* "Filler" icon to take up the same space */
40+ width : 1rem ;
41+ height : 1rem ;
42+ }
43+ .message-index {
44+ user-select : none;
45+ }
3746 .content {
3847 text-wrap : wrap;
3948 }
Original file line number Diff line number Diff line change @@ -13,6 +13,16 @@ export type ConsoleMessage = {
1313 id : string ;
1414} ;
1515
16+ function ConsoleIcon ( { type } : { type : ConsoleMessageType } ) {
17+ if ( type === "error" ) {
18+ return < Icon href = { statusError } /> ;
19+ }
20+ if ( type === "warn" ) {
21+ return < Icon href = { statusWarning } /> ;
22+ }
23+ return < div className = "no-icon" > </ div > ;
24+ }
25+
1626export function ConsoleMirror ( {
1727 logs,
1828 expanded : consoleExpanded ,
@@ -63,12 +73,6 @@ export function ConsoleMirror({
6373 </ div >
6474 ) }
6575 { logs . map ( ( log , i ) => {
66- let icon = "" ;
67- if ( log . type === "warn" ) {
68- icon = statusWarning ;
69- } else if ( log . type === "error" ) {
70- icon = statusError ;
71- }
7276 return (
7377 < div
7478 key = { i }
@@ -77,10 +81,9 @@ export function ConsoleMirror({
7781 error : log . type === "error" ,
7882 } ) }
7983 >
80- < Icon href = { icon } />
81- < pre className = "content" >
82- { i + 1 } : { log . message }
83- </ pre >
84+ < ConsoleIcon type = { log . type } />
85+ < span className = "message-index" > { i + 1 } :</ span >
86+ < pre className = "content" > { log . message } </ pre >
8487 </ div >
8588 ) ;
8689 } ) }
You can’t perform that action at this time.
0 commit comments