import type { IOmnichannelServiceLevelAgreements, Serialized } from '@rocket.chat/core-typings'; import type { SelectOption } from '@rocket.chat/fuselage'; import { Field, FieldLabel, FieldRow, Select } from '@rocket.chat/fuselage'; import { useId, useMemo } from 'react'; import { useHasLicenseModule } from '../../../hooks/useHasLicenseModule'; export type SlaPoliciesSelectProps = { value: string; label: string; options: Serialized; onChange: (value: string) => void; }; export const SlaPoliciesSelect = ({ value, label, options, onChange }: SlaPoliciesSelectProps) => { const { data: hasLicense = false } = useHasLicenseModule('livechat-enterprise'); const optionsSelect = useMemo(() => options?.map((option) => [option._id, option.name]), [options]); const fieldId = useId(); if (!hasLicense) { return null; } return ( {label}