import type { ILivechatTrigger } from '@rocket.chat/core-typings'; import { Callout } from '@rocket.chat/fuselage'; import { ContextualbarSkeletonBody } from '@rocket.chat/ui-client'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import { useTranslation } from 'react-i18next'; import EditTrigger from './EditTrigger'; const EditTriggerWithData = ({ triggerId, onClose }: { triggerId: ILivechatTrigger['_id']; onClose: () => void }) => { const { t } = useTranslation(); const getTriggersById = useEndpoint('GET', '/v1/livechat/triggers/:_id', { _id: triggerId }); const { data, isPending, isError } = useQuery({ queryKey: ['livechat-getTriggersById', triggerId], queryFn: async () => getTriggersById(), refetchOnWindowFocus: false, }); if (isPending) { return ; } if (isError) { return {t('Error')}; } return ; }; export default EditTriggerWithData;