UNPKG

@rjsf/core

Version:

A simple React component capable of building HTML forms out of a JSON schema.

10 lines (9 loc) 757 B
import { jsx as _jsx } from "react/jsx-runtime"; import { TranslatableString } from '@rjsf/utils'; import IconButton from './IconButton.js'; /** The `AddButton` renders a button that represent the `Add` action on a form */ export default function AddButton({ id, className, onClick, disabled, registry, }) { const { translateString } = registry; return (_jsx("div", { className: 'row', children: _jsx("p", { className: `col-xs-4 col-sm-2 col-lg-1 col-xs-offset-8 col-sm-offset-10 col-lg-offset-11 text-right ${className}`, children: _jsx(IconButton, { id: id, iconType: 'info', icon: 'plus', className: 'btn-add col-xs-12', title: translateString(TranslatableString.AddButton), onClick: onClick, disabled: disabled, registry: registry }) }) })); }