import type { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
import { TranslatableString } from '@rjsf/utils';
import { Button } from 'primereact/button';

/** The `AddButton` renders a button that represents the `Add` action on a form
 */
export default function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
  uiSchema,
  registry,
  color,
  ...props
}: IconButtonProps<T, S, F>) {
  const { translateString } = registry;
  return (
    <Button
      label={translateString(TranslatableString.AddItemButton)}
      icon='pi pi-plus'
      outlined
      severity='secondary'
      size='small'
      {...props}
    />
  );
}
