mirror of
https://github.com/umami-software/umami.git
synced 2026-02-17 02:55:38 +01:00
Segment editing.
This commit is contained in:
parent
fba7e12c36
commit
2dbcf63eeb
22 changed files with 306 additions and 42 deletions
|
|
@ -0,0 +1,24 @@
|
|||
import { SegmentAddButton } from './SegmentAddButton';
|
||||
import { useWebsiteSegmentsQuery } from '@/components/hooks';
|
||||
import { SegmentsTable } from './SegmentsTable';
|
||||
import { DataGrid } from '@/components/common/DataGrid';
|
||||
|
||||
export function SegmentsDataTable({ websiteId }: { websiteId?: string }) {
|
||||
const query = useWebsiteSegmentsQuery(websiteId, { type: 'segment' });
|
||||
|
||||
const renderActions = () => {
|
||||
return <SegmentAddButton websiteId={websiteId} />;
|
||||
};
|
||||
|
||||
return (
|
||||
<DataGrid
|
||||
query={query}
|
||||
allowSearch={true}
|
||||
autoFocus={false}
|
||||
allowPaging={true}
|
||||
renderActions={renderActions}
|
||||
>
|
||||
{({ data }) => <SegmentsTable data={data} />}
|
||||
</DataGrid>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue