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