feat: UI component rendering in agent dialog mode (#1083)

Co-authored-by: csunny <cfqsunny@163.com>
This commit is contained in:
Hzh_97
2024-01-18 11:08:02 +08:00
committed by GitHub
parent 674104eb7c
commit 0936856c3a
46 changed files with 1597 additions and 73 deletions

View File

@@ -1,7 +1,7 @@
import { Empty, Row, Col, Select, Tooltip } from 'antd';
import { Advice, Advisor } from '@antv/ava';
import { Chart } from '@berryv/g2-react';
import i18n from '@/app/i18n';
import i18n, { I18nKeys } from '@/app/i18n';
import { customizeAdvisor, getVisAdvices } from './advisor/pipeline';
import { useContext, useEffect, useMemo, useState } from 'react';
import { defaultAdvicesFilter } from './advisor/utils';
@@ -62,6 +62,8 @@ export const AutoChart = (props: AutoChartProps) => {
options={{
...spec,
theme: mode,
autoFit: true,
height: 300,
}}
/>
);
@@ -83,7 +85,7 @@ export const AutoChart = (props: AutoChartProps) => {
size={'small'}
>
{advices?.map((item) => {
const name = i18n.t(item.type);
const name = i18n.t(item.type as I18nKeys);
return (
<Option key={item.type} value={item.type}>