import { Button } from "@/components/ui/button"; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "@/components/ui/command"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; import { Check, ChevronsUpDown } from "lucide-react"; import { ZWebhookEvent, zWebhookEventSchema, } from "@karakeep/shared/types/webhooks"; export function WebhookEventSelector({ value, onChange, }: { value: ZWebhookEvent[]; onChange: (value: ZWebhookEvent[]) => void; }) { return ( No events found. {zWebhookEventSchema.options.map((eventType) => ( { const newEvents = value.includes(eventType) ? value.filter((e) => e !== eventType) : [...value, eventType]; onChange(newEvents); }} > {eventType} {value?.includes(eventType) && ( )} ))} ); }