diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2020-11-09 12:30:41 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2020-11-09 12:30:41 +0530 |
commit | b0e3a32b65d7485b43befb1feec173f2a575fcd0 (patch) | |
tree | a7c9644c726517d803bfb5476b02f4f110c5721a /modern/src/reports/RouteReportPage.js | |
parent | 449e5e3190d22704a2cb4d7c5ce3e90eaaf16153 (diff) | |
download | etbsa-traccar-web-b0e3a32b65d7485b43befb1feec173f2a575fcd0.tar.gz etbsa-traccar-web-b0e3a32b65d7485b43befb1feec173f2a575fcd0.tar.bz2 etbsa-traccar-web-b0e3a32b65d7485b43befb1feec173f2a575fcd0.zip |
Minor Report Layout Modifications
Diffstat (limited to 'modern/src/reports/RouteReportPage.js')
-rw-r--r-- | modern/src/reports/RouteReportPage.js | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js index 30272c4..0f8d98a 100644 --- a/modern/src/reports/RouteReportPage.js +++ b/modern/src/reports/RouteReportPage.js @@ -3,29 +3,28 @@ import { TableContainer, Table, TableRow, TableCell, TableHead, TableBody, Paper import t from '../common/localization'; import { formatPosition } from '../common/formatter'; import ReportFilter from './ReportFilter'; -import ReportView from './ReportView'; +import ReportLayoutPage from './ReportLayoutPage'; -const RouteReportPage = () => { - - const ReportFilterForm = ({ onResult }) => { +const ReportFilterForm = ({ onResult }) => { - const handleSubmit = async (deviceId, from, to) => { - const query = new URLSearchParams({ - deviceId, - from: from.toISOString(), - to: to.toISOString(), - }); - const response = await fetch(`/api/reports/route?${query.toString()}`, { headers: { Accept: 'application/json' } }); - if(response.ok) { - onResult(await response.json()); - } + const handleSubmit = async (deviceId, from, to) => { + const query = new URLSearchParams({ + deviceId, + from: from.toISOString(), + to: to.toISOString(), + }); + const response = await fetch(`/api/reports/route?${query.toString()}`, { headers: { Accept: 'application/json' } }); + if(response.ok) { + onResult(await response.json()); } - return <ReportFilter handleSubmit={handleSubmit} />; } + return <ReportFilter handleSubmit={handleSubmit} />; +} - const ReportListView = ({items}) => { - - return ( +const RouteReportPage = () => { + const [items, setItems] = useState([]); + return ( + <ReportLayoutPage reportFilterForm={ReportFilterForm} setItems={setItems}> <TableContainer component={Paper}> <Table> <TableHead> @@ -50,10 +49,8 @@ const RouteReportPage = () => { </TableBody> </Table> </TableContainer> - ); - } - - return <ReportView reportFilterForm={ReportFilterForm} reportListView={ReportListView} />; + </ReportLayoutPage> + ); } export default RouteReportPage; |