umami/components/pages/websites/WebsiteTableView.js

60 lines
2.0 KiB
JavaScript
Raw Normal View History

2023-02-04 17:59:52 +01:00
import { useState } from 'react';
import { GridRow, GridColumn } from 'components/layout/Grid';
2023-02-04 17:59:52 +01:00
import PagesTable from 'components/metrics/PagesTable';
import ReferrersTable from 'components/metrics/ReferrersTable';
import BrowsersTable from 'components/metrics/BrowsersTable';
import OSTable from 'components/metrics/OSTable';
import DevicesTable from 'components/metrics/DevicesTable';
import WorldMap from 'components/common/WorldMap';
import CountriesTable from 'components/metrics/CountriesTable';
import EventsTable from 'components/metrics/EventsTable';
import EventsChart from 'components/metrics/EventsChart';
export default function WebsiteTableView({ websiteId }) {
const [countryData, setCountryData] = useState();
const tableProps = {
websiteId,
limit: 10,
};
return (
<>
<GridRow>
<GridColumn variant="two">
2023-02-04 17:59:52 +01:00
<PagesTable {...tableProps} />
</GridColumn>
<GridColumn variant="two">
2023-02-04 17:59:52 +01:00
<ReferrersTable {...tableProps} />
</GridColumn>
</GridRow>
<GridRow>
<GridColumn variant="three">
2023-02-04 17:59:52 +01:00
<BrowsersTable {...tableProps} />
</GridColumn>
<GridColumn variant="three">
2023-02-04 17:59:52 +01:00
<OSTable {...tableProps} />
</GridColumn>
<GridColumn variant="three">
2023-02-04 17:59:52 +01:00
<DevicesTable {...tableProps} />
</GridColumn>
</GridRow>
<GridRow>
<GridColumn xs={12} sm={12} md={12} defaultSize={8}>
2023-02-04 17:59:52 +01:00
<WorldMap data={countryData} />
</GridColumn>
<GridColumn xs={12} sm={12} md={12} defaultSize={4}>
2023-02-04 17:59:52 +01:00
<CountriesTable {...tableProps} onDataLoad={setCountryData} />
</GridColumn>
</GridRow>
<GridRow>
<GridColumn xs={12} sm={12} md={12} lg={4} defaultSize={4}>
2023-02-04 17:59:52 +01:00
<EventsTable {...tableProps} />
</GridColumn>
<GridColumn xs={12} sm={12} md={12} lg={8} defaultSize={8}>
2023-02-04 17:59:52 +01:00
<EventsChart websiteId={websiteId} />
</GridColumn>
</GridRow>
2023-02-04 17:59:52 +01:00
</>
);
}