chatflow/workflow add field required (#18892)

This commit is contained in:
Junjie.M
2025-04-27 16:12:02 +08:00
committed by GitHub
parent 0e0ec4691a
commit e3daef19e7
11 changed files with 26 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ type Props = {
children?: React.JSX.Element | string | null
operations?: React.JSX.Element
inline?: boolean
required?: boolean
}
const Field: FC<Props> = ({
@@ -28,6 +29,7 @@ const Field: FC<Props> = ({
operations,
inline,
supportFold,
required,
}) => {
const [fold, {
toggle: toggleFold,
@@ -38,7 +40,9 @@ const Field: FC<Props> = ({
onClick={() => supportFold && toggleFold()}
className={cn('flex items-center justify-between', supportFold && 'cursor-pointer')}>
<div className='flex h-6 items-center'>
<div className={cn(isSubTitle ? 'system-xs-medium-uppercase text-text-tertiary' : 'system-sm-semibold-uppercase text-text-secondary')}>{title}</div>
<div className={cn(isSubTitle ? 'system-xs-medium-uppercase text-text-tertiary' : 'system-sm-semibold-uppercase text-text-secondary')}>
{title} {required && <span className='text-text-destructive'>*</span>}
</div>
{tooltip && (
<Tooltip
popupContent={tooltip}