components.widgets.Form.fieldsets.MultiFieldset.MultiFieldsetItemToolbar.tsx Maven / Gradle / Ivy
import React from 'react'
import { Button } from 'reactstrap'
export interface Props {
needCopyButton: boolean
needRemoveButton: boolean
disabled: boolean
index: number
canRemoveFirstItem: boolean
onRemoveField(index: number): void
onCopyField(index: number): void
}
/* FIXME сделать нормальный toolbar */
export function MultiFieldsetItemToolbar({
needCopyButton,
needRemoveButton,
disabled,
index,
canRemoveFirstItem,
onRemoveField,
onCopyField,
}: Props) {
const onCopyClick = () => onCopyField(index)
const onRemoveClick = () => onRemoveField(index)
return (
{needCopyButton && (
)}
{needRemoveButton && index > +!canRemoveFirstItem - 1 && (
)}
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy