import { Control, Controller } from "react-hook-form"; import { IWebhookIndividualOptions, IExtendedWebhook } from "types/webhook"; export enum IndividualWebhookTypes { PROJECTS = "Projects", MODULES = "Modules", CYCLES = "Cycles", ISSUES = "Issues", ISSUE_COMMENTS = "Issue Comments", } export const individualWebhookOptions: IWebhookIndividualOptions[] = [ { key: "project_toggle", label: IndividualWebhookTypes.PROJECTS, name: "project", }, { key: "cycle-toggle", label: IndividualWebhookTypes.CYCLES, name: "cycle", }, { key: "issue_toggle", label: IndividualWebhookTypes.ISSUES, name: "issue", }, { key: "module_toggle", label: IndividualWebhookTypes.MODULES, name: "module", }, { key: "issue_comment_toggle", label: IndividualWebhookTypes.ISSUE_COMMENTS, name: "issue_comment", }, ]; interface IWebHookIndividualOptions { control: Control; } export const WebHookIndividualOptions = ({ control }: IWebHookIndividualOptions) => ( <>
{individualWebhookOptions.map(({ key, label, name }: IWebhookIndividualOptions) => ( (
onChange(!value)} type="checkbox" name="selectIndividualEvents" checked={value == true} />
)} /> ))}
);