umami/src/app/(main)/websites/[websiteId]/WebsiteTableView.tsx

49 lines
1.5 KiB
TypeScript
Raw Normal View History

2023-02-04 16:59:52 +00:00
import { useState } from 'react';
2023-10-03 06:51:26 +00:00
import { Grid, GridRow } from 'components/layout/Grid';
2023-02-04 16:59:52 +00: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';
2023-11-03 22:46:12 +00:00
import WorldMap from 'components/metrics/WorldMap';
2023-02-04 16:59:52 +00:00
import CountriesTable from 'components/metrics/CountriesTable';
import EventsTable from 'components/metrics/EventsTable';
import EventsChart from 'components/metrics/EventsChart';
2023-12-13 08:02:54 +00:00
export default function WebsiteTableView({
websiteId,
domainName,
}: {
websiteId: string;
domainName: string;
}) {
2023-02-04 16:59:52 +00:00
const [countryData, setCountryData] = useState();
const tableProps = {
websiteId,
2023-12-13 08:02:54 +00:00
domainName,
2023-02-04 16:59:52 +00:00
limit: 10,
};
return (
2023-10-03 06:51:26 +00:00
<Grid>
<GridRow columns="two">
<PagesTable {...tableProps} />
<ReferrersTable {...tableProps} />
</GridRow>
2023-10-03 06:51:26 +00:00
<GridRow columns="three">
<BrowsersTable {...tableProps} />
<OSTable {...tableProps} />
<DevicesTable {...tableProps} />
</GridRow>
2023-10-03 06:51:26 +00:00
<GridRow columns="two-one">
<WorldMap data={countryData} />
<CountriesTable {...tableProps} onDataLoad={setCountryData} />
</GridRow>
2023-10-03 06:51:26 +00:00
<GridRow columns="one-two">
<EventsTable {...tableProps} />
<EventsChart websiteId={websiteId} />
</GridRow>
2023-10-03 06:51:26 +00:00
</Grid>
2023-02-04 16:59:52 +00:00
);
}