mirror of
https://github.com/umami-software/umami.git
synced 2026-02-24 22:45:36 +01:00
New website nav.
This commit is contained in:
parent
5e6799a715
commit
a534c51b5e
38 changed files with 190 additions and 159 deletions
|
|
@ -1,55 +0,0 @@
|
|||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { Button, Column, Box, Text, Icon, DialogTrigger, Modal, Dialog } from '@umami/react-zen';
|
||||
import { useDateRange, useMessages } from '@/components/hooks';
|
||||
import { ListCheck } from '@/components/icons';
|
||||
import { Panel } from '@/components/common/Panel';
|
||||
import { Breakdown } from './Breakdown';
|
||||
import { WebsiteControls } from '@/app/(main)/websites/[websiteId]/WebsiteControls';
|
||||
import { FieldSelectForm } from '@/app/(main)/websites/[websiteId]/reports/breakdown/FieldSelectForm';
|
||||
|
||||
export function BreakdownPage({ websiteId }: { websiteId: string }) {
|
||||
const {
|
||||
dateRange: { startDate, endDate },
|
||||
} = useDateRange(websiteId);
|
||||
const [fields, setFields] = useState(['path']);
|
||||
|
||||
return (
|
||||
<Column gap>
|
||||
<WebsiteControls websiteId={websiteId} />
|
||||
<FieldsButton value={fields} onChange={setFields} />
|
||||
<Panel height="900px" overflow="auto" allowFullscreen>
|
||||
<Breakdown
|
||||
websiteId={websiteId}
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
selectedFields={fields}
|
||||
/>
|
||||
</Panel>
|
||||
</Column>
|
||||
);
|
||||
}
|
||||
|
||||
const FieldsButton = ({ value, onChange }) => {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<DialogTrigger>
|
||||
<Button>
|
||||
<Icon>
|
||||
<ListCheck />
|
||||
</Icon>
|
||||
<Text>Fields</Text>
|
||||
</Button>
|
||||
<Modal>
|
||||
<Dialog title={formatMessage(labels.fields)} style={{ width: 400 }}>
|
||||
{({ close }) => (
|
||||
<FieldSelectForm selectedFields={value} onChange={onChange} onClose={close} />
|
||||
)}
|
||||
</Dialog>
|
||||
</Modal>
|
||||
</DialogTrigger>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue