refactor: 移除多余的空行,简化 AIResponseBox 组件代码

This commit is contained in:
sd0ric4
2025-03-27 14:58:20 +08:00
parent c61b5af826
commit 7f05a2ef1e

View File

@@ -88,7 +88,6 @@ const RenderText = React.memo(function RenderText({
let source = text || ''; let source = text || '';
return <Markdown source={source} showAnimation={showAnimation} />; return <Markdown source={source} showAnimation={showAnimation} />;
}); });
const RenderTool = React.memo( const RenderTool = React.memo(
function RenderTool({ function RenderTool({
showAnimation, showAnimation,
@@ -210,7 +209,6 @@ const RenderUserFormInteractive = React.memo(function RenderFormInput({
interactive: InteractiveBasicType & UserInputInteractive; interactive: InteractiveBasicType & UserInputInteractive;
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
const defaultValues = useMemo(() => { const defaultValues = useMemo(() => {
if (interactive.type === 'userInput') { if (interactive.type === 'userInput') {
return interactive.params.inputForm?.reduce((acc: Record<string, any>, item) => { return interactive.params.inputForm?.reduce((acc: Record<string, any>, item) => {
@@ -220,7 +218,6 @@ const RenderUserFormInteractive = React.memo(function RenderFormInput({
} }
return {}; return {};
}, [interactive]); }, [interactive]);
const handleFormSubmit = useCallback((data: Record<string, any>) => { const handleFormSubmit = useCallback((data: Record<string, any>) => {
onSendPrompt({ onSendPrompt({
text: JSON.stringify(data), text: JSON.stringify(data),