@@ -2,23 +2,22 @@ import React, { useMemo } from 'react';
22
33import { CodeSnippet , InlineLoading } from '@carbon/react' ;
44
5- // import './Output.scss';
65
7- export default function Output ( { output, loading } ) {
6+ export default function Output ( { output, running } ) {
87
98 const value = useMemo ( ( ) => {
10- if ( output instanceof Error ) {
9+ if ( error ) {
1110 return output . message ;
1211 }
1312 return JSON . stringify ( output , null , 2 ) ;
14- } , [ output ] ) ;
13+ } , [ output , error ] ) ;
1514
1615 const error = useMemo ( ( ) => {
1716 return output instanceof Error ;
1817 } , [ output ] ) ;
1918
2019 const status = useMemo ( ( ) => {
21- if ( loading ) {
20+ if ( running ) {
2221 return (
2322 < InlineLoading
2423 description = "Running task..."
@@ -36,7 +35,7 @@ export default function Output({ output, loading }) {
3635 }
3736
3837 return < div > No output</ div > ;
39- } , [ loading , output , error ] ) ;
38+ } , [ running , output , error ] ) ;
4039
4140 return (
4241 < div className = "section" >
@@ -53,7 +52,7 @@ export default function Output({ output, loading }) {
5352 { status }
5453 </ div >
5554 < div className = "result" >
56- { value && ! loading && < CodeSnippet
55+ { value && ! running && < CodeSnippet
5756 className = "snippet"
5857 type = "multi"
5958 align = "left"
0 commit comments