diff options
| author | lazydancer <jrpucula@gmail.com> | 2024-12-22 17:33:11 -0500 |
|---|---|---|
| committer | lazydancer <jrpucula@gmail.com> | 2024-12-22 17:33:11 -0500 |
| commit | 2c5b7da8165e3f8b90748e8ced1de0e3e8d52309 (patch) | |
| tree | 6d6e4e1d0cb0c7ec5e1dff83bfeda4b044258b81 /frontend/src/Path.js | |
| download | haul-2c5b7da8165e3f8b90748e8ced1de0e3e8d52309.tar.gz | |
Initial
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 |
