umami/src/app/(main)/websites/[websiteId]/cohorts/CohortEditButton.tsx
Mike Cao 40492ec7c4
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
Added DialogButton to handle mobile.
2025-10-16 23:59:18 -07:00

38 lines
899 B
TypeScript

import { Edit } from '@/components/icons';
import { CohortEditForm } from '@/app/(main)/websites/[websiteId]/cohorts/CohortEditForm';
import { useMessages } from '@/components/hooks';
import { Filter } from '@/lib/types';
import { DialogButton } from '@/components/input/DialogButton';
export function CohortEditButton({
cohortId,
websiteId,
filters,
}: {
cohortId: string;
websiteId: string;
filters: Filter[];
}) {
const { formatMessage, labels } = useMessages();
return (
<DialogButton
icon={<Edit />}
variant="quiet"
title={formatMessage(labels.cohort)}
width="800px"
minHeight="300px"
>
{({ close }) => {
return (
<CohortEditForm
cohortId={cohortId}
websiteId={websiteId}
filters={filters}
onClose={close}
/>
);
}}
</DialogButton>
);
}