- {showPrefix &&
{prefixIcon ?? }}
+
+ {showLeftIcon &&
}
{
- setLocalValue(e.target.value)
- onChange && onChange(e.target.value)
- }}
+ style={styleCss}
+ className={cn(
+ 'w-full py-[7px] bg-components-input-bg-normal border border-transparent text-components-input-text-filled hover:bg-components-input-bg-hover hover:border-components-input-border-hover focus:bg-components-input-bg-active focus:border-components-input-border-active focus:shadow-xs placeholder:text-components-input-text-placeholder appearance-none outline-none caret-primary-600',
+ inputVariants({ size }),
+ showLeftIcon && 'pl-[26px]',
+ showLeftIcon && size === 'large' && 'pl-7',
+ showClearIcon && value && 'pr-[26px]',
+ showClearIcon && value && size === 'large' && 'pr-7',
+ destructive && 'pr-[26px]',
+ destructive && size === 'large' && 'pr-7',
+ disabled && 'bg-components-input-bg-disabled border-transparent text-components-input-text-filled-disabled cursor-not-allowed hover:bg-components-input-bg-disabled hover:border-transparent',
+ destructive && 'bg-components-input-bg-destructive border-components-input-border-destructive text-components-input-text-filled hover:bg-components-input-bg-destructive hover:border-components-input-border-destructive focus:bg-components-input-bg-destructive focus:border-components-input-border-destructive',
+ className,
+ )}
+ placeholder={placeholder ?? (showLeftIcon ? t('common.operation.search') ?? '' : 'please input')}
+ value={value}
+ onChange={onChange}
+ disabled={disabled}
+ {...props}
/>
+ {showClearIcon && value && !disabled && !destructive && (
+
+
+
+ )}
+ {destructive && (
+
+ )}
)
}
diff --git a/web/app/components/base/markdown.tsx b/web/app/components/base/markdown.tsx
index af4b13ff70deaf..6e8ae6c9e62f0b 100644
--- a/web/app/components/base/markdown.tsx
+++ b/web/app/components/base/markdown.tsx
@@ -8,7 +8,7 @@ import RemarkGfm from 'remark-gfm'
import SyntaxHighlighter from 'react-syntax-highlighter'
import { atelierHeathLight } from 'react-syntax-highlighter/dist/esm/styles/hljs'
import type { RefObject } from 'react'
-import { memo, useEffect, useMemo, useRef, useState } from 'react'
+import { Component, memo, useEffect, useMemo, useRef, useState } from 'react'
import type { CodeComponent } from 'react-markdown/lib/ast-to-react'
import cn from '@/utils/classnames'
import CopyBtn from '@/app/components/base/copy-btn'
@@ -104,7 +104,7 @@ const CodeBlock: CodeComponent = memo(({ inline, className, children, ...props }
const match = /language-(\w+)/.exec(className || '')
const language = match?.[1]
const languageShowName = getCorrectCapitalizationLanguageName(language || '')
- let chartData = JSON.parse(String('{"title":{"text":"Something went wrong."}}').replace(/\n$/, ''))
+ let chartData = JSON.parse(String('{"title":{"text":"ECharts error - Wrong JSON format."}}').replace(/\n$/, ''))
if (language === 'echarts') {
try {
chartData = JSON.parse(String(children).replace(/\n$/, ''))
@@ -143,10 +143,10 @@ const CodeBlock: CodeComponent = memo(({ inline, className, children, ...props }
? (
)
: (
(language === 'echarts')
- ? (
-
)
+
)
: (