import type { UseFormReturn } from 'react-hook-form' // End of third-party imports import { SupportCategories } from '@supabase/shared-types/out/constants' import { FormControl_Shadcn_, FormField_Shadcn_ } from 'ui' import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout' import { MultiSelectV2 } from 'ui-patterns/MultiSelectDeprecated/MultiSelectV2' import { type ExtendedSupportCategories, SERVICE_OPTIONS } 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 ( ( form.setValue('affectedServices', services.join(', '))} /> )} /> ) }