import { Control, Controller } from "react-hook-form"; import { IWebhook } from "types/webhook"; export const INDIVIDUAL_WEBHOOK_OPTIONS: { key: keyof IWebhook; label: string; description: string; }[] = [ { key: "project", label: "Projects", description: "Project created, updated, or deleted", }, { key: "cycle", label: "Cycles", description: "Cycle created, updated, or deleted", }, { key: "issue", label: "Issues", description: "Issue created, updated, deleted, added to a cycle or module", }, { key: "module", label: "Modules", description: "Module created, updated, or deleted", }, { key: "issue_comment", label: "Issue comments", description: "Comment posted, updated, or deleted", }, ]; type Props = { control: Control; }; export const WebhookIndividualEventOptions = ({ control }: Props) => (
{INDIVIDUAL_WEBHOOK_OPTIONS.map((option) => ( (
onChange(!value)} type="checkbox" name="selectIndividualEvents" checked={value === true} />

{option.description}

)} /> ))}
);