mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
726f4668e0
* refactor: webhooks workflow * chore: update delete modal content
29 lines
677 B
TypeScript
29 lines
677 B
TypeScript
import { Control, Controller } from "react-hook-form";
|
|
// ui
|
|
import { ToggleSwitch } from "@plane/ui";
|
|
// types
|
|
import { IWebhook } from "types/webhook";
|
|
|
|
interface IWebHookToggle {
|
|
control: Control<IWebhook, any>;
|
|
}
|
|
|
|
export const WebhookToggle = ({ control }: IWebHookToggle) => (
|
|
<div className="flex gap-6">
|
|
<div className="text-sm font-medium">Enable webhook</div>
|
|
<Controller
|
|
control={control}
|
|
name="is_active"
|
|
render={({ field: { onChange, value } }) => (
|
|
<ToggleSwitch
|
|
value={value}
|
|
onChange={(val: boolean) => {
|
|
onChange(val);
|
|
}}
|
|
size="sm"
|
|
/>
|
|
)}
|
|
/>
|
|
</div>
|
|
);
|