mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
34 lines
954 B
TypeScript
34 lines
954 B
TypeScript
import { ActionButton } from '@/components/input/ActionButton';
|
|
import { Edit } from '@/components/icons';
|
|
import { Dialog } from '@umami/react-zen';
|
|
import { SegmentEditForm } from '@/app/(main)/websites/[websiteId]/segments/SegmentEditForm';
|
|
import { useMessages } from '@/components/hooks';
|
|
|
|
export function SegmentEditButton({
|
|
segmentId,
|
|
websiteId,
|
|
filters,
|
|
}: {
|
|
segmentId: string;
|
|
websiteId: string;
|
|
filters?: any[];
|
|
}) {
|
|
const { formatMessage, labels } = useMessages();
|
|
|
|
return (
|
|
<ActionButton title={formatMessage(labels.edit)} icon={<Edit />}>
|
|
<Dialog title={formatMessage(labels.segment)} style={{ width: 800, minHeight: 300 }}>
|
|
{({ close }) => {
|
|
return (
|
|
<SegmentEditForm
|
|
segmentId={segmentId}
|
|
websiteId={websiteId}
|
|
filters={filters}
|
|
onClose={close}
|
|
/>
|
|
);
|
|
}}
|
|
</Dialog>
|
|
</ActionButton>
|
|
);
|
|
}
|