@botonic/react 0.42.0-alpha.4 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,4 +7,5 @@ export interface ConditionalQueueStatusDebugEvent {
7
7
  is_queue_open: boolean;
8
8
  is_available_agent: boolean;
9
9
  }
10
+ export declare const ConditionalQueueStatus: (props: ConditionalQueueStatusDebugEvent) => import("react/jsx-runtime").JSX.Element;
10
11
  export declare const getConditionalQueueStatusEventConfig: (data: ConditionalQueueStatusDebugEvent) => DebugEventConfig;
@@ -1,20 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConditionalQueueStatusEventConfig = void 0;
3
+ exports.getConditionalQueueStatusEventConfig = exports.ConditionalQueueStatus = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const core_1 = require("@botonic/core");
6
6
  const split_1 = require("../icons/split");
7
+ const styles_1 = require("../styles");
8
+ const constants_1 = require("./constants");
9
+ const ConditionalQueueStatus = (props) => {
10
+ const queueStatus = props.is_queue_open ? constants_1.LABELS.OPEN : constants_1.LABELS.CLOSED;
11
+ const agentStatus = props.is_available_agent ? constants_1.LABELS.YES : constants_1.LABELS.NO;
12
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledDebugDetail, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledDebugLabel, { children: constants_1.LABELS.QUEUE }), (0, jsx_runtime_1.jsx)(styles_1.StyledDebugValue, { children: props.queue_name })] }), (0, jsx_runtime_1.jsxs)(styles_1.StyledDebugDetail, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledDebugLabel, { children: constants_1.LABELS.STATUS }), (0, jsx_runtime_1.jsx)(styles_1.StyledDebugValue, { children: queueStatus })] }), (0, jsx_runtime_1.jsxs)(styles_1.StyledDebugDetail, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledDebugLabel, { children: constants_1.LABELS.AGENTS_AVAILABLE }), (0, jsx_runtime_1.jsx)(styles_1.StyledDebugValue, { children: agentStatus })] })] }));
13
+ };
14
+ exports.ConditionalQueueStatus = ConditionalQueueStatus;
7
15
  const getConditionalQueueStatusEventConfig = (data) => {
8
- const queueStatus = data.is_queue_open ? 'Open' : 'Closed';
9
- const agentStatus = data.is_available_agent ? 'Available' : 'Unavailable';
10
- const statusText = `${queueStatus}${queueStatus === 'Open' ? ` (Agent ${agentStatus})` : ''}`;
11
- const title = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Queue status checked", ' ', (0, jsx_runtime_1.jsxs)("span", { children: ["- ", statusText, " ( Queue: ", data.queue_name, ")"] })] }));
16
+ const title = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Queue status checked ", (0, jsx_runtime_1.jsxs)("span", { children: ["- ", data.queue_name] })] }));
12
17
  return {
13
18
  action: core_1.EventAction.ConditionalQueueStatus,
14
19
  title,
15
- component: null,
20
+ component: exports.ConditionalQueueStatus,
16
21
  icon: (0, jsx_runtime_1.jsx)(split_1.SplitSvg, {}),
17
- collapsible: false,
22
+ collapsible: true,
18
23
  };
19
24
  };
20
25
  exports.getConditionalQueueStatusEventConfig = getConditionalQueueStatusEventConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"conditional-queue-status.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/conditional-queue-status.tsx"],"names":[],"mappings":";;;;AAAA,wCAA2C;AAG3C,0CAAyC;AAWlC,MAAM,oCAAoC,GAAG,CAClD,IAAsC,EACpB,EAAE;IACpB,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAA;IACzE,MAAM,UAAU,GAAG,GAAG,WAAW,GAAG,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;IAE7F,MAAM,KAAK,GAAG,CACZ,qFACuB,GAAG,EACxB,mDACK,UAAU,gBAAY,IAAI,CAAC,UAAU,SACnC,IACN,CACJ,CAAA;IAED,OAAO;QACL,MAAM,EAAE,kBAAW,CAAC,sBAAsB;QAC1C,KAAK;QACL,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,uBAAC,gBAAQ,KAAG;QAClB,WAAW,EAAE,KAAK;KACnB,CAAA;AACH,CAAC,CAAA;AAvBY,QAAA,oCAAoC,wCAuBhD"}
1
+ {"version":3,"file":"conditional-queue-status.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/conditional-queue-status.tsx"],"names":[],"mappings":";;;;AAAA,wCAA2C;AAG3C,0CAAyC;AACzC,sCAIkB;AAElB,2CAAoC;AAU7B,MAAM,sBAAsB,GAAG,CACpC,KAAuC,EACvC,EAAE;IACF,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,kBAAM,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAM,CAAC,MAAM,CAAA;IACrE,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,kBAAM,CAAC,GAAG,CAAC,CAAC,CAAC,kBAAM,CAAC,EAAE,CAAA;IAErE,OAAO,CACL,6DACE,wBAAC,0BAAiB,eAChB,uBAAC,yBAAgB,cAAE,kBAAM,CAAC,KAAK,GAAoB,EACnD,uBAAC,yBAAgB,cAAE,KAAK,CAAC,UAAU,GAAoB,IACrC,EACpB,wBAAC,0BAAiB,eAChB,uBAAC,yBAAgB,cAAE,kBAAM,CAAC,MAAM,GAAoB,EACpD,uBAAC,yBAAgB,cAAE,WAAW,GAAoB,IAChC,EACpB,wBAAC,0BAAiB,eAChB,uBAAC,yBAAgB,cAAE,kBAAM,CAAC,gBAAgB,GAAoB,EAC9D,uBAAC,yBAAgB,cAAE,WAAW,GAAoB,IAChC,IACnB,CACJ,CAAA;AACH,CAAC,CAAA;AAtBY,QAAA,sBAAsB,0BAsBlC;AAEM,MAAM,oCAAoC,GAAG,CAClD,IAAsC,EACpB,EAAE;IACpB,MAAM,KAAK,GAAG,CACZ,sFACuB,mDAAS,IAAI,CAAC,UAAU,IAAQ,IACpD,CACJ,CAAA;IAED,OAAO;QACL,MAAM,EAAE,kBAAW,CAAC,sBAAsB;QAC1C,KAAK;QACL,SAAS,EAAE,8BAAsB;QACjC,IAAI,EAAE,uBAAC,gBAAQ,KAAG;QAClB,WAAW,EAAE,IAAI;KAClB,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,oCAAoC,wCAgBhD"}
@@ -16,4 +16,10 @@ export declare const LABELS: {
16
16
  readonly NOTE: "Note";
17
17
  readonly KNOWLEDGE_BASE_FAIL_REASON: "Knowledge Base Fail Reason";
18
18
  readonly SEE_CHUNKS_BUTTON: "See chunks";
19
+ readonly STATUS: "Status";
20
+ readonly YES: "Yes";
21
+ readonly NO: "No";
22
+ readonly OPEN: "Open";
23
+ readonly CLOSED: "Closed";
24
+ readonly AGENTS_AVAILABLE: "Agents available";
19
25
  };
@@ -19,5 +19,11 @@ exports.LABELS = {
19
19
  NOTE: 'Note',
20
20
  KNOWLEDGE_BASE_FAIL_REASON: 'Knowledge Base Fail Reason',
21
21
  SEE_CHUNKS_BUTTON: 'See chunks',
22
+ STATUS: 'Status',
23
+ YES: 'Yes',
24
+ NO: 'No',
25
+ OPEN: 'Open',
26
+ CLOSED: 'Closed',
27
+ AGENTS_AVAILABLE: 'Agents available',
22
28
  };
23
29
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IACpB,mBAAmB,EAAE,qBAAqB;IAC1C,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,kBAAkB,EAAE,oBAAoB;IACxC,cAAc,EAAE,gBAAgB;IAChC,iBAAiB,EAAE,mBAAmB;IACtC,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,KAAK;IACtB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,MAAM;IACZ,0BAA0B,EAAE,4BAA4B;IACxD,iBAAiB,EAAE,YAAY;CACvB,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IACpB,mBAAmB,EAAE,qBAAqB;IAC1C,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,kBAAkB,EAAE,oBAAoB;IACxC,cAAc,EAAE,gBAAgB;IAChC,iBAAiB,EAAE,mBAAmB;IACtC,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,KAAK;IACtB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,MAAM;IACZ,0BAA0B,EAAE,4BAA4B;IACxD,iBAAiB,EAAE,YAAY;IAC/B,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,kBAAkB;CAC5B,CAAA"}
@@ -7,4 +7,5 @@ export interface ConditionalQueueStatusDebugEvent {
7
7
  is_queue_open: boolean;
8
8
  is_available_agent: boolean;
9
9
  }
10
+ export declare const ConditionalQueueStatus: (props: ConditionalQueueStatusDebugEvent) => import("react/jsx-runtime").JSX.Element;
10
11
  export declare const getConditionalQueueStatusEventConfig: (data: ConditionalQueueStatusDebugEvent) => DebugEventConfig;
@@ -1,17 +1,21 @@
1
- import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { EventAction } from '@botonic/core';
3
3
  import { SplitSvg } from '../icons/split';
4
+ import { StyledDebugDetail, StyledDebugLabel, StyledDebugValue, } from '../styles';
5
+ import { LABELS } from './constants';
6
+ export const ConditionalQueueStatus = (props) => {
7
+ const queueStatus = props.is_queue_open ? LABELS.OPEN : LABELS.CLOSED;
8
+ const agentStatus = props.is_available_agent ? LABELS.YES : LABELS.NO;
9
+ return (_jsxs(_Fragment, { children: [_jsxs(StyledDebugDetail, { children: [_jsx(StyledDebugLabel, { children: LABELS.QUEUE }), _jsx(StyledDebugValue, { children: props.queue_name })] }), _jsxs(StyledDebugDetail, { children: [_jsx(StyledDebugLabel, { children: LABELS.STATUS }), _jsx(StyledDebugValue, { children: queueStatus })] }), _jsxs(StyledDebugDetail, { children: [_jsx(StyledDebugLabel, { children: LABELS.AGENTS_AVAILABLE }), _jsx(StyledDebugValue, { children: agentStatus })] })] }));
10
+ };
4
11
  export const getConditionalQueueStatusEventConfig = (data) => {
5
- const queueStatus = data.is_queue_open ? 'Open' : 'Closed';
6
- const agentStatus = data.is_available_agent ? 'Available' : 'Unavailable';
7
- const statusText = `${queueStatus}${queueStatus === 'Open' ? ` (Agent ${agentStatus})` : ''}`;
8
- const title = (_jsxs(_Fragment, { children: ["Queue status checked", ' ', _jsxs("span", { children: ["- ", statusText, " ( Queue: ", data.queue_name, ")"] })] }));
12
+ const title = (_jsxs(_Fragment, { children: ["Queue status checked ", _jsxs("span", { children: ["- ", data.queue_name] })] }));
9
13
  return {
10
14
  action: EventAction.ConditionalQueueStatus,
11
15
  title,
12
- component: null,
16
+ component: ConditionalQueueStatus,
13
17
  icon: _jsx(SplitSvg, {}),
14
- collapsible: false,
18
+ collapsible: true,
15
19
  };
16
20
  };
17
21
  //# sourceMappingURL=conditional-queue-status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditional-queue-status.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/conditional-queue-status.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAG3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAWzC,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAClD,IAAsC,EACpB,EAAE;IACpB,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAA;IACzE,MAAM,UAAU,GAAG,GAAG,WAAW,GAAG,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;IAE7F,MAAM,KAAK,GAAG,CACZ,sDACuB,GAAG,EACxB,iCACK,UAAU,gBAAY,IAAI,CAAC,UAAU,SACnC,IACN,CACJ,CAAA;IAED,OAAO;QACL,MAAM,EAAE,WAAW,CAAC,sBAAsB;QAC1C,KAAK;QACL,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,KAAC,QAAQ,KAAG;QAClB,WAAW,EAAE,KAAK;KACnB,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"conditional-queue-status.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/conditional-queue-status.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAG3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,WAAW,CAAA;AAElB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAUpC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAuC,EACvC,EAAE;IACF,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAA;IACrE,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAA;IAErE,OAAO,CACL,8BACE,MAAC,iBAAiB,eAChB,KAAC,gBAAgB,cAAE,MAAM,CAAC,KAAK,GAAoB,EACnD,KAAC,gBAAgB,cAAE,KAAK,CAAC,UAAU,GAAoB,IACrC,EACpB,MAAC,iBAAiB,eAChB,KAAC,gBAAgB,cAAE,MAAM,CAAC,MAAM,GAAoB,EACpD,KAAC,gBAAgB,cAAE,WAAW,GAAoB,IAChC,EACpB,MAAC,iBAAiB,eAChB,KAAC,gBAAgB,cAAE,MAAM,CAAC,gBAAgB,GAAoB,EAC9D,KAAC,gBAAgB,cAAE,WAAW,GAAoB,IAChC,IACnB,CACJ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAClD,IAAsC,EACpB,EAAE;IACpB,MAAM,KAAK,GAAG,CACZ,uDACuB,iCAAS,IAAI,CAAC,UAAU,IAAQ,IACpD,CACJ,CAAA;IAED,OAAO;QACL,MAAM,EAAE,WAAW,CAAC,sBAAsB;QAC1C,KAAK;QACL,SAAS,EAAE,sBAAsB;QACjC,IAAI,EAAE,KAAC,QAAQ,KAAG;QAClB,WAAW,EAAE,IAAI;KAClB,CAAA;AACH,CAAC,CAAA"}
@@ -16,4 +16,10 @@ export declare const LABELS: {
16
16
  readonly NOTE: "Note";
17
17
  readonly KNOWLEDGE_BASE_FAIL_REASON: "Knowledge Base Fail Reason";
18
18
  readonly SEE_CHUNKS_BUTTON: "See chunks";
19
+ readonly STATUS: "Status";
20
+ readonly YES: "Yes";
21
+ readonly NO: "No";
22
+ readonly OPEN: "Open";
23
+ readonly CLOSED: "Closed";
24
+ readonly AGENTS_AVAILABLE: "Agents available";
19
25
  };
@@ -16,5 +16,11 @@ export const LABELS = {
16
16
  NOTE: 'Note',
17
17
  KNOWLEDGE_BASE_FAIL_REASON: 'Knowledge Base Fail Reason',
18
18
  SEE_CHUNKS_BUTTON: 'See chunks',
19
+ STATUS: 'Status',
20
+ YES: 'Yes',
21
+ NO: 'No',
22
+ OPEN: 'Open',
23
+ CLOSED: 'Closed',
24
+ AGENTS_AVAILABLE: 'Agents available',
19
25
  };
20
26
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,mBAAmB,EAAE,qBAAqB;IAC1C,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,kBAAkB,EAAE,oBAAoB;IACxC,cAAc,EAAE,gBAAgB;IAChC,iBAAiB,EAAE,mBAAmB;IACtC,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,KAAK;IACtB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,MAAM;IACZ,0BAA0B,EAAE,4BAA4B;IACxD,iBAAiB,EAAE,YAAY;CACvB,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,mBAAmB,EAAE,qBAAqB;IAC1C,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,kBAAkB,EAAE,oBAAoB;IACxC,cAAc,EAAE,gBAAgB;IAChC,iBAAiB,EAAE,mBAAmB;IACtC,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,KAAK;IACtB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,MAAM;IACZ,0BAA0B,EAAE,4BAA4B;IACxD,iBAAiB,EAAE,YAAY;IAC/B,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,kBAAkB;CAC5B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/react",
3
- "version": "0.42.0-alpha.4",
3
+ "version": "0.42.0",
4
4
  "license": "MIT",
5
5
  "description": "Build Chatbots using React",
6
6
  "main": "./lib/cjs",
@@ -21,7 +21,7 @@
21
21
  "lint_core": "../../node_modules/.bin/eslint_d --cache --quiet '.*.js' '*.js' 'src/**/*.js*' --fix"
22
22
  },
23
23
  "dependencies": {
24
- "@botonic/core": "0.42.0-alpha.4",
24
+ "@botonic/core": "^0.42.0",
25
25
  "axios": "^1.12.2",
26
26
  "emoji-picker-react": "^4.12.0",
27
27
  "lodash.merge": "^4.6.2",
@@ -81,4 +81,4 @@
81
81
  "javascript",
82
82
  "react"
83
83
  ]
84
- }
84
+ }
@@ -2,7 +2,13 @@ import { EventAction } from '@botonic/core'
2
2
  import React from 'react'
3
3
 
4
4
  import { SplitSvg } from '../icons/split'
5
+ import {
6
+ StyledDebugDetail,
7
+ StyledDebugLabel,
8
+ StyledDebugValue,
9
+ } from '../styles'
5
10
  import { DebugEventConfig } from '../types'
11
+ import { LABELS } from './constants'
6
12
 
7
13
  export interface ConditionalQueueStatusDebugEvent {
8
14
  action: EventAction.ConditionalQueueStatus
@@ -12,27 +18,44 @@ export interface ConditionalQueueStatusDebugEvent {
12
18
  is_available_agent: boolean
13
19
  }
14
20
 
21
+ export const ConditionalQueueStatus = (
22
+ props: ConditionalQueueStatusDebugEvent
23
+ ) => {
24
+ const queueStatus = props.is_queue_open ? LABELS.OPEN : LABELS.CLOSED
25
+ const agentStatus = props.is_available_agent ? LABELS.YES : LABELS.NO
26
+
27
+ return (
28
+ <>
29
+ <StyledDebugDetail>
30
+ <StyledDebugLabel>{LABELS.QUEUE}</StyledDebugLabel>
31
+ <StyledDebugValue>{props.queue_name}</StyledDebugValue>
32
+ </StyledDebugDetail>
33
+ <StyledDebugDetail>
34
+ <StyledDebugLabel>{LABELS.STATUS}</StyledDebugLabel>
35
+ <StyledDebugValue>{queueStatus}</StyledDebugValue>
36
+ </StyledDebugDetail>
37
+ <StyledDebugDetail>
38
+ <StyledDebugLabel>{LABELS.AGENTS_AVAILABLE}</StyledDebugLabel>
39
+ <StyledDebugValue>{agentStatus}</StyledDebugValue>
40
+ </StyledDebugDetail>
41
+ </>
42
+ )
43
+ }
44
+
15
45
  export const getConditionalQueueStatusEventConfig = (
16
46
  data: ConditionalQueueStatusDebugEvent
17
47
  ): DebugEventConfig => {
18
- const queueStatus = data.is_queue_open ? 'Open' : 'Closed'
19
- const agentStatus = data.is_available_agent ? 'Available' : 'Unavailable'
20
- const statusText = `${queueStatus}${queueStatus === 'Open' ? ` (Agent ${agentStatus})` : ''}`
21
-
22
48
  const title = (
23
49
  <>
24
- Queue status checked{' '}
25
- <span>
26
- - {statusText} ( Queue: {data.queue_name})
27
- </span>
50
+ Queue status checked <span>- {data.queue_name}</span>
28
51
  </>
29
52
  )
30
53
 
31
54
  return {
32
55
  action: EventAction.ConditionalQueueStatus,
33
56
  title,
34
- component: null,
57
+ component: ConditionalQueueStatus,
35
58
  icon: <SplitSvg />,
36
- collapsible: false,
59
+ collapsible: true,
37
60
  }
38
61
  }
@@ -16,4 +16,10 @@ export const LABELS = {
16
16
  NOTE: 'Note',
17
17
  KNOWLEDGE_BASE_FAIL_REASON: 'Knowledge Base Fail Reason',
18
18
  SEE_CHUNKS_BUTTON: 'See chunks',
19
+ STATUS: 'Status',
20
+ YES: 'Yes',
21
+ NO: 'No',
22
+ OPEN: 'Open',
23
+ CLOSED: 'Closed',
24
+ AGENTS_AVAILABLE: 'Agents available',
19
25
  } as const