Skip to content
Snippets Groups Projects
Unverified Commit b75cd484 authored by Martin Schoeler's avatar Martin Schoeler Committed by GitHub
Browse files

refactor: Realtime Monitoring Overviews to TS (#33167)

parent bf03fe82
No related branches found
No related tags found
No related merge requests found
import type { OperationParams } from '@rocket.chat/rest-typings';
import type { MutableRefObject } from 'react';
import React from 'react';
import { useEndpointData } from '../../../../hooks/useEndpointData';
......@@ -8,9 +10,14 @@ const overviewInitalValue = {
value: '-',
};
type AgentsOverviewChartsProps = {
params: OperationParams<'GET', '/v1/livechat/analytics/dashboards/agents-productivity-totalizers'>;
reloadRef: MutableRefObject<{ [x: string]: () => void }>;
};
const initialData = [overviewInitalValue, overviewInitalValue, overviewInitalValue];
const AgentsOverview = ({ params, reloadRef, ...props }) => {
const AgentsOverview = ({ params, reloadRef, ...props }: AgentsOverviewChartsProps) => {
const {
value: data,
phase: state,
......
import type { OperationParams } from '@rocket.chat/rest-typings';
import type { MutableRefObject } from 'react';
import React from 'react';
import { useEndpointData } from '../../../../hooks/useEndpointData';
......@@ -9,7 +11,12 @@ const initialData = [
{ title: '', value: '00:00:00' },
];
const ChatsOverview = ({ params, reloadRef, ...props }) => {
type ChatsOverviewProps = {
params: OperationParams<'GET', '/v1/livechat/analytics/dashboards/chats-totalizers'>;
reloadRef: MutableRefObject<{ [x: string]: () => void }>;
};
const ChatsOverview = ({ params, reloadRef, ...props }: ChatsOverviewProps) => {
const { value: data, phase: state, reload } = useEndpointData('/v1/livechat/analytics/dashboards/chats-totalizers', { params });
reloadRef.current.chatsOverview = reload;
......
import type { OperationParams } from '@rocket.chat/rest-typings';
import type { MutableRefObject } from 'react';
import React from 'react';
import { useEndpointData } from '../../../../hooks/useEndpointData';
......@@ -10,7 +12,12 @@ const overviewInitalValue = {
const initialData = [overviewInitalValue, overviewInitalValue, overviewInitalValue, overviewInitalValue];
const ConversationOverview = ({ params, reloadRef, ...props }) => {
type ConversationOverviewProps = {
params: OperationParams<'GET', '/v1/livechat/analytics/dashboards/conversation-totalizers'>;
reloadRef: MutableRefObject<{ [x: string]: () => void }>;
};
const ConversationOverview = ({ params, reloadRef, ...props }: ConversationOverviewProps) => {
const { value: data, phase: state, reload } = useEndpointData('/v1/livechat/analytics/dashboards/conversation-totalizers', { params });
reloadRef.current.conversationOverview = reload;
......
import type { OperationParams } from '@rocket.chat/rest-typings';
import type { MutableRefObject } from 'react';
import React from 'react';
import { useEndpointData } from '../../../../hooks/useEndpointData';
......@@ -7,7 +9,12 @@ const defaultValue = { title: '', value: '00:00:00' };
const initialData = [defaultValue, defaultValue, defaultValue, defaultValue];
const ProductivityOverview = ({ params, reloadRef, ...props }) => {
type ProductivityOverviewProps = {
params: OperationParams<'GET', '/v1/livechat/analytics/dashboards/productivity-totalizers'>;
reloadRef: MutableRefObject<{ [x: string]: () => void }>;
};
const ProductivityOverview = ({ params, reloadRef, ...props }: ProductivityOverviewProps) => {
const { value: data, phase: state, reload } = useEndpointData('/v1/livechat/analytics/dashboards/productivity-totalizers', { params });
reloadRef.current.productivityOverview = reload;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment