dify/web/app/components/datasets/metadata/edit-metadata-batch/add-row.tsx
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

40 lines
1.1 KiB
TypeScript

'use client'
import type { FC } from 'react'
import type { MetadataItemWithEdit } from '../types'
import { cn } from '@langgenius/dify-ui/cn'
import { RiIndeterminateCircleLine } from '@remixicon/react'
import * as React from 'react'
import InputCombined from './input-combined'
import Label from './label'
type Props = Readonly<{
className?: string
payload: MetadataItemWithEdit
onChange: (value: MetadataItemWithEdit) => void
onRemove: () => void
}>
const AddRow: FC<Props> = ({ className, payload, onChange, onRemove }) => {
return (
<div className={cn('flex h-6 items-center space-x-0.5', className)}>
<Label text={payload.name} />
<InputCombined
label={payload.name}
type={payload.type}
value={payload.value}
onChange={(value) => onChange({ ...payload, value })}
/>
<div
className={cn(
'cursor-pointer rounded-md p-1 text-text-tertiary hover:bg-state-destructive-hover hover:text-text-destructive',
)}
onClick={onRemove}
>
<RiIndeterminateCircleLine className="size-4" />
</div>
</div>
)
}
export default React.memo(AddRow)