mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-18 05:29:45 -05:00
37 lines
989 B
TypeScript
37 lines
989 B
TypeScript
import { useRouter } from "next/navigation";
|
|
|
|
import { Button } from "../Button";
|
|
import { Modal } from "../Modal";
|
|
|
|
type TSegmentAlreadyUsedModalProps = {
|
|
open: boolean;
|
|
setOpen: (open: boolean) => void;
|
|
environmentId: string;
|
|
};
|
|
|
|
export const SegmentAlreadyUsedModal = ({ open, setOpen, environmentId }: TSegmentAlreadyUsedModalProps) => {
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<Modal open={open} setOpen={setOpen} title="Forward to Segments View">
|
|
<p>This segment is used in other surveys. To assure consistent data you cannot edit it here.</p>
|
|
<div className="space-x-2 text-right">
|
|
<Button
|
|
variant="warn"
|
|
onClick={() => {
|
|
setOpen(false);
|
|
}}>
|
|
Discard
|
|
</Button>
|
|
<Button
|
|
variant="darkCTA"
|
|
onClick={() => {
|
|
router.push(`/environments/${environmentId}/segments`);
|
|
}}>
|
|
Go to Segments
|
|
</Button>
|
|
</div>
|
|
</Modal>
|
|
);
|
|
};
|