diff options
Diffstat (limited to 'frontend/src/Log.js')
| -rw-r--r-- | frontend/src/Log.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/frontend/src/Log.js b/frontend/src/Log.js new file mode 100644 index 0000000..565396f --- /dev/null +++ b/frontend/src/Log.js @@ -0,0 +1,18 @@ +import React from 'react'; +import useSSE from './useSSE'; +import LogComponent from './LogComponent'; // Import the DataDisplay component + +const Log = () => { + const { data, error } = useSSE('http://localhost:8000/data_stream', 2000); + + console.log("Log Data: ", data); + + return ( + <div className="text-white"> + {error && <p>Error: {error}</p>} + {data ? <LogComponent messages={data.log} /> : <p>Loading data...</p>} + </div> + ); + }; + +export default Log;
\ No newline at end of file |
