Segment editing.

This commit is contained in:
Mike Cao 2025-07-31 21:32:22 -07:00
parent fba7e12c36
commit 2dbcf63eeb
22 changed files with 306 additions and 42 deletions

View file

@ -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>
);
}