import { FormControl, FormLabel, FormErrorMessage, Center, Spinner, Text, Flex, chakra } from '@chakra-ui/react'; import { UsersIcon, ServerStackIcon } from '@heroicons/react/24/outline'; import { IconBaseStyle } from 'constants/IconBaseStyle'; import { TFunction } from 'i18next'; import { Controller } from 'react-hook-form'; import { Service } from 'types'; import { SystemPropertyStatus } from 'components/system-property-status'; import { ServicesSelectList } from './services-select-list'; const UsersServiceIcon = chakra(UsersIcon, IconBaseStyle); const InboundsServiceIcon = chakra(ServerStackIcon, IconBaseStyle); interface ServicesFieldProps { form: any; services: Service[]; t: TFunction<'translation', undefined, 'translation'>; } export const ServicesField = ({ form, t, services }: ServicesFieldProps) => { return services.length === 0 ? (
) : ( {t('userDialog.services')} { return ( ( {service.name} / )} /> ); }} /> {t( form.formState.errors.services ?.message as string )} ); }