From ae07ebc75a7b74de53c307fb83658668751c74a7 Mon Sep 17 00:00:00 2001 From: atrincas Date: Tue, 3 Dec 2024 11:57:28 +0100 Subject: [PATCH] Display repsonse rate in sandbox --- client/src/containers/sandbox/index.tsx | 1 + client/src/containers/sandbox/user-sandbox/index.tsx | 7 ++++++- client/src/containers/widget/widget-header/index.tsx | 2 +- client/src/hooks/use-sandbox-widget.ts | 6 +++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/client/src/containers/sandbox/index.tsx b/client/src/containers/sandbox/index.tsx index 27528ea4..c833ffd0 100644 --- a/client/src/containers/sandbox/index.tsx +++ b/client/src/containers/sandbox/index.tsx @@ -38,6 +38,7 @@ const Sandbox: FC = () => { = ({ customWidgetId }) => { }, { enabled: !!indicator, - select: (res) => res.body.data, + select: (res) => ({ + ...res.body.data, + responseRate: getResponseRate(res.body.data.data), + }), }, ); @@ -76,6 +80,7 @@ const Sandbox: FC = ({ customWidgetId }) => { {widget && ( ({ ...res.body.data, data: normalizeWidgetData(res.body.data.data), + responseRate: getResponseRate(res.body.data.data), }), }, );