fix display of preview

This commit is contained in:
JzoNg 2026-01-12 15:55:52 +08:00
parent b6db6d9305
commit 7deaab116a
2 changed files with 5 additions and 11 deletions

View File

@ -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}
/>
) )
})(), })(),
}} }}

View File

@ -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>
</>
) )
} }