feat: new meta data
parent
3a72b76c32
commit
f4604bf6d0
@ -0,0 +1,45 @@
|
|||||||
|
'use client'
|
||||||
|
import type { FC } from 'react'
|
||||||
|
import React from 'react'
|
||||||
|
import type { MetadataItemWithEdit } from '../types'
|
||||||
|
import cn from '@/utils/classnames'
|
||||||
|
import Label from './label'
|
||||||
|
import InputCombined from './input-combined'
|
||||||
|
import { RiIndeterminateCircleLine } from '@remixicon/react'
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
className?: string
|
||||||
|
payload: MetadataItemWithEdit
|
||||||
|
onChange: (value: any) => 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
|
||||||
|
type={payload.type}
|
||||||
|
value={payload.value}
|
||||||
|
onChange={onChange}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
cn(
|
||||||
|
'p-1 rounded-md text-text-tertiary hover:bg-state-destructive-hover hover:text-text-destructive cursor-pointer',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onClick={onRemove}
|
||||||
|
>
|
||||||
|
<RiIndeterminateCircleLine className='size-4' />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default React.memo(AddRow)
|
||||||
Loading…
Reference in New Issue