chore: jsx to react to jsx

This commit is contained in:
Joel
2025-02-08 16:08:41 +08:00
parent d062519f60
commit 1e4f3bc459
41 changed files with 483 additions and 250 deletions

View File

@ -32,7 +32,7 @@ type BeforeRunFormProps = {
onRun: (submitData: Record<string, any>) => void
onStop: () => void
runningStatus: NodeRunningStatus
result?: JSX.Element
result?: React.JSX.Element
forms: FormProps[]
showSpecialResultPanel?: boolean
} & Partial<SpecialResultPanelProps>

View File

@ -6,8 +6,8 @@ export { default as FieldCollapse } from './field-collapse'
type CollapseProps = {
disabled?: boolean
trigger: JSX.Element
children: JSX.Element
trigger: React.JSX.Element
children: React.JSX.Element
collapsed?: boolean
onCollapse?: (collapsed: boolean) => void
}

View File

@ -16,11 +16,11 @@ import useToggleExpend from '@/app/components/workflow/nodes/_base/hooks/use-tog
import type { FileEntity } from '@/app/components/base/file-uploader/types'
import FileListInLog from '@/app/components/base/file-uploader/file-list-in-log'
interface Props {
type Props = {
className?: string
title: JSX.Element | string
headerRight?: JSX.Element
children: JSX.Element
title: React.JSX.Element | string
headerRight?: React.JSX.Element
children: React.JSX.Element
minHeight?: number
value: string
isFocus: boolean
@ -33,7 +33,7 @@ interface Props {
}[]
showFileList?: boolean
showCodeGenerator?: boolean
tip?: JSX.Element
tip?: React.JSX.Element
}
const Base: FC<Props> = ({
@ -85,7 +85,7 @@ const Base: FC<Props> = ({
{headerRight}
{showCodeGenerator && codeLanguages && (
<div className='ml-1'>
<CodeGeneratorButton onGenerated={onGenerated} codeLanguages={codeLanguages}/>
<CodeGeneratorButton onGenerated={onGenerated} codeLanguages={codeLanguages} />
</div>
)}
{!isCopied

View File

@ -18,11 +18,11 @@ const CODE_EDITOR_LINE_HEIGHT = 18
export type Props = {
value?: string | object
placeholder?: JSX.Element | string
placeholder?: React.JSX.Element | string
onChange?: (value: string) => void
title?: JSX.Element
title?: React.JSX.Element
language: CodeLanguage
headerRight?: JSX.Element
headerRight?: React.JSX.Element
readOnly?: boolean
isJSONStringifyBeauty?: boolean
height?: number
@ -34,7 +34,7 @@ export type Props = {
onGenerated?: (value: string) => void
showCodeGenerator?: boolean
className?: string
tip?: JSX.Element
tip?: React.JSX.Element
}
export const languageMap = {

View File

@ -7,8 +7,8 @@ import Base from './base'
type Props = {
value: string
onChange: (value: string) => void
title: JSX.Element | string
headerRight?: JSX.Element
title: React.JSX.Element | string
headerRight?: React.JSX.Element
minHeight?: number
onBlur?: () => void
placeholder?: string

View File

@ -14,8 +14,8 @@ type Props = {
tooltip?: ReactNode
isSubTitle?: boolean
supportFold?: boolean
children?: JSX.Element | string | null
operations?: JSX.Element
children?: React.JSX.Element | string | null
operations?: React.JSX.Element
inline?: boolean
}

View File

@ -19,7 +19,7 @@ const Icon = () => {
type NodeResizerProps = {
nodeId: string
nodeData: CommonNodeType
icon?: JSX.Element
icon?: React.JSX.Element
minWidth?: number
minHeight?: number
maxWidth?: number

View File

@ -41,7 +41,7 @@ type Props = {
className?: string
headerClassName?: string
instanceId?: string
title: string | JSX.Element
title: string | React.JSX.Element
value: string
onChange: (value: string) => void
readOnly?: boolean

View File

@ -35,7 +35,7 @@ const ReadonlyInputWithSelectVar: FC<Props> = ({
return VAR_PLACEHOLDER
})
const html: JSX.Element[] = strWithVarPlaceholder.split(VAR_PLACEHOLDER).map((str, index) => {
const html: React.JSX.Element[] = strWithVarPlaceholder.split(VAR_PLACEHOLDER).map((str, index) => {
if (!vars[index])
return <span className='relative top-[-3px] leading-[16px]' key={index}>{str}</span>

View File

@ -11,7 +11,7 @@ type Item = {
}
type Props = {
className?: string
trigger?: JSX.Element
trigger?: React.JSX.Element
DropDownIcon?: any
noLeft?: boolean
options: Item[]

View File

@ -17,7 +17,7 @@ import cn from '@/utils/classnames'
const i18nPrefix = 'workflow.nodes.http.authorization'
interface Props {
type Props = {
nodeId: string
payload: AuthorizationPayloadType
onChange: (payload: AuthorizationPayloadType) => void
@ -25,7 +25,7 @@ interface Props {
onHide: () => void
}
const Field = ({ title, isRequired, children }: { title: string; isRequired?: boolean; children: JSX.Element }) => {
const Field = ({ title, isRequired, children }: { title: string; isRequired?: boolean; children: React.JSX.Element }) => {
return (
<div>
<div className='leading-8 text-[13px] font-medium text-gray-700'>

View File

@ -13,12 +13,12 @@ import { Edit03 } from '@/app/components/base/icons/src/vender/solid/general'
import Badge from '@/app/components/base/badge'
import ConfigVarModal from '@/app/components/app/configuration/config-var/config-modal'
interface Props {
type Props = {
readonly: boolean
payload: InputVar
onChange?: (item: InputVar, moreInfo?: MoreInfo) => void
onRemove?: () => void
rightContent?: JSX.Element
rightContent?: React.JSX.Element
varKeys?: string[]
showLegacyBadge?: boolean
}