diff options
Diffstat (limited to 'frontend/src/Info.js')
| -rw-r--r-- | frontend/src/Info.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/frontend/src/Info.js b/frontend/src/Info.js new file mode 100644 index 0000000..3fcfa3e --- /dev/null +++ b/frontend/src/Info.js @@ -0,0 +1,16 @@ +import React from 'react'; +import usePolling from './usePolling'; +import InfoDisplay from './InfoDisplay'; // Import the DataDisplay component + +const Info = () => { + const { data, error } = usePolling('http://localhost:8000/route_info', 1000); + + return ( + <div className="text-white"> + {error && <p>Error: {error}</p>} + {data ? <InfoDisplay data={data} /> : <p>Loading data...</p>} + </div> + ); + }; + +export default Info;
\ No newline at end of file |
