mirror of
https://github.com/umami-software/umami.git
synced 2026-02-17 11:05:36 +01:00
Refactor part 2: Electric Boogaloo. Standardize way of passing filter parameters.
This commit is contained in:
parent
f26f1b0581
commit
cdf391d5c2
90 changed files with 867 additions and 709 deletions
|
|
@ -1,21 +1,15 @@
|
|||
import { useWebsiteSessionsQuery } from '@/components/hooks';
|
||||
import { SessionsTable } from './SessionsTable';
|
||||
import { DataGrid } from '@/components/common/DataGrid';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export function SessionsDataTable({
|
||||
websiteId,
|
||||
children,
|
||||
}: {
|
||||
websiteId?: string;
|
||||
teamId?: string;
|
||||
children?: ReactNode;
|
||||
}) {
|
||||
export function SessionsDataTable({ websiteId }: { websiteId?: string; teamId?: string }) {
|
||||
const queryResult = useWebsiteSessionsQuery(websiteId);
|
||||
|
||||
return (
|
||||
<DataGrid queryResult={queryResult} renderEmpty={() => children} allowPaging>
|
||||
{({ data }) => <SessionsTable data={data} showDomain={!websiteId} />}
|
||||
<DataGrid queryResult={queryResult} allowPaging allowSearch>
|
||||
{({ data }) => {
|
||||
return <SessionsTable data={data} showDomain={!websiteId} />;
|
||||
}}
|
||||
</DataGrid>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export function SessionsTable({ data = [] }: { data: any[]; showDomain?: boolean
|
|||
<DataColumn id="id" label={formatMessage(labels.session)} width="100px">
|
||||
{(row: any) => (
|
||||
<Link href={`sessions/${row.id}`}>
|
||||
<Avatar seed={row.id} size={64} />
|
||||
<Avatar seed={row.id} size={48} />
|
||||
</Link>
|
||||
)}
|
||||
</DataColumn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue