mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-18 09:41:32 -05:00
Co-authored-by: Piyush Gupta <piyushguptaa2z123@gmail.com> Co-authored-by: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com> Co-authored-by: Victor Hugo dos Santos <115753265+victorvhs017@users.noreply.github.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com> Co-authored-by: Matti Nannt <matti@formbricks.com> Co-authored-by: Matti Nannt <mail@matthiasnannt.com> Co-authored-by: Johannes <johannes@formbricks.com> Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
"use client";
|
|
|
|
import { Webhook } from "lucide-react";
|
|
import { useState } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import { TEnvironment } from "@formbricks/types/environment";
|
|
import { TSurvey } from "@formbricks/types/surveys/types";
|
|
import { Button } from "@/modules/ui/components/button";
|
|
import { AddWebhookModal } from "./add-webhook-modal";
|
|
|
|
interface AddWebhookButtonProps {
|
|
environment: TEnvironment;
|
|
surveys: TSurvey[];
|
|
}
|
|
|
|
export const AddWebhookButton = ({ environment, surveys }: AddWebhookButtonProps) => {
|
|
const { t } = useTranslation();
|
|
const [isAddWebhookModalOpen, setAddWebhookModalOpen] = useState(false);
|
|
return (
|
|
<>
|
|
<Button
|
|
size="sm"
|
|
onClick={() => {
|
|
setAddWebhookModalOpen(true);
|
|
}}>
|
|
<Webhook className="mr-2 h-5 w-5 text-white" />
|
|
{t("environments.integrations.webhooks.add_webhook")}
|
|
</Button>
|
|
<AddWebhookModal
|
|
environmentId={environment.id}
|
|
surveys={surveys}
|
|
open={isAddWebhookModalOpen}
|
|
setOpen={setAddWebhookModalOpen}
|
|
/>
|
|
</>
|
|
);
|
|
};
|