// End of third-party imports import { SupportCategories } from '@supabase/shared-types/out/constants' import type { UseFormReturn } from 'react-hook-form' import { FormControl, FormField } from 'ui' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import { MultiSelector, MultiSelectorContent, MultiSelectorItem, MultiSelectorList, MultiSelectorTrigger, } from 'ui-patterns/multi-select' import { SERVICE_OPTIONS, type ExtendedSupportCategories } from './Support.constants' import type { SupportFormValues } from './SupportForm.schema' interface AffectedServicesSelectorProps { form: UseFormReturn category: ExtendedSupportCategories } export const CATEGORIES_WITHOUT_AFFECTED_SERVICES: ExtendedSupportCategories[] = [ SupportCategories.LOGIN_ISSUES, 'Plan_upgrade', ] export function AffectedServicesSelector({ form, category }: AffectedServicesSelectorProps) { if (CATEGORIES_WITHOUT_AFFECTED_SERVICES.includes(category)) return null return ( ( field.onChange(services.join(', '))} > {SERVICE_OPTIONS.map((service) => ( {service.name} ))} )} /> ) }