mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 12:37:20 +08:00
fix display of preview
This commit is contained in:
parent
b6db6d9305
commit
7deaab116a
@ -62,10 +62,7 @@ const FormContentPreview: FC<FormContentPreviewProps> = ({
|
|||||||
}
|
}
|
||||||
const placeholder = input.placeholder
|
const placeholder = input.placeholder
|
||||||
return (
|
return (
|
||||||
<Note
|
<Note placeholder={placeholder!} />
|
||||||
placeholder={placeholder!}
|
|
||||||
title={name}
|
|
||||||
/>
|
|
||||||
)
|
)
|
||||||
})(),
|
})(),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -123,14 +123,11 @@ export const Variable: React.FC<{ path: string }> = ({ path }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Note: React.FC<{ placeholder: FormInputItemPlaceholder, title: string }> = ({ placeholder, title }) => {
|
export const Note: React.FC<{ placeholder: FormInputItemPlaceholder }> = ({ placeholder }) => {
|
||||||
const isVariable = placeholder.type === 'variable'
|
const isVariable = placeholder.type === 'variable'
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="mt-3 rounded-[10px] bg-components-input-bg-normal px-2.5 py-2">
|
||||||
<h2>{title}</h2>
|
{isVariable ? <Variable path={`{{${placeholder.selector.join('.')}}}`} /> : <span>{placeholder.value}</span>}
|
||||||
<div className="mt-3 rounded-[10px] bg-components-input-bg-normal px-2.5 py-2">
|
</div>
|
||||||
{isVariable ? <Variable path={`{{${placeholder.selector.join('.')}}}`} /> : <span>{placeholder.value}</span>}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user