mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 20:17:29 +08:00
fix: large data markdown ui problems
This commit is contained in:
parent
d755b2885e
commit
08d6fcfd52
@ -22,10 +22,11 @@ type DisplayContentProps = {
|
|||||||
readonly: boolean
|
readonly: boolean
|
||||||
handleTextChange?: (value: string) => void
|
handleTextChange?: (value: string) => void
|
||||||
handleEditorChange?: (value: string) => void
|
handleEditorChange?: (value: string) => void
|
||||||
|
className?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const DisplayContent = (props: DisplayContentProps) => {
|
const DisplayContent = (props: DisplayContentProps) => {
|
||||||
const { previewType, varType, schemaType, mdString, jsonString, readonly, handleTextChange, handleEditorChange } = props
|
const { previewType, varType, schemaType, mdString, jsonString, readonly, handleTextChange, handleEditorChange, className } = props
|
||||||
const [viewMode, setViewMode] = useState<ViewMode>(ViewMode.Code)
|
const [viewMode, setViewMode] = useState<ViewMode>(ViewMode.Code)
|
||||||
const [isFocused, setIsFocused] = useState(false)
|
const [isFocused, setIsFocused] = useState(false)
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
@ -50,7 +51,7 @@ const DisplayContent = (props: DisplayContentProps) => {
|
|||||||
}, [previewType, schemaType, jsonString])
|
}, [previewType, schemaType, jsonString])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn('flex h-full flex-col rounded-[10px] bg-components-input-bg-normal', isFocused && 'bg-components-input-bg-active outline outline-1 outline-components-input-border-active')}>
|
<div className={cn('flex h-full flex-col rounded-[10px] bg-components-input-bg-normal', isFocused && 'bg-components-input-bg-active outline outline-1 outline-components-input-border-active', className)}>
|
||||||
<div className='flex shrink-0 items-center justify-end p-1'>
|
<div className='flex shrink-0 items-center justify-end p-1'>
|
||||||
{previewType === PreviewType.Markdown && (
|
{previewType === PreviewType.Markdown && (
|
||||||
<div className='system-xs-semibold-uppercase flex grow items-center px-2 py-0.5 text-text-secondary'>
|
<div className='system-xs-semibold-uppercase flex grow items-center px-2 py-0.5 text-text-secondary'>
|
||||||
|
|||||||
@ -198,6 +198,7 @@ const ValueContent = ({
|
|||||||
mdString={value as any}
|
mdString={value as any}
|
||||||
readonly={textEditorDisabled}
|
readonly={textEditorDisabled}
|
||||||
handleTextChange={handleTextChange}
|
handleTextChange={handleTextChange}
|
||||||
|
className={cn(isTruncated && 'pt-[36px]')}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Textarea
|
<Textarea
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user