Debian Codegraph @

packages/mui/src/AddButton/AddButton.tsx

raw
1 import AddIcon from '@mui/icons-material/Add';
2 import IconButton from '@mui/material/IconButton';
3 import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
4
5 /** The `AddButton` renders a button that represent the `Add` action on a form
6 */
7 export default function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({
8 uiSchema,
9 registry,
10 ...props
11 }: IconButtonProps<T, S, F>) {
12 const { translateString } = registry;
13 return (
14 <IconButton title={translateString(TranslatableString.AddItemButton)} {...props} color='primary'>
15 <AddIcon />
16 </IconButton>
17 );
18 }