hooks/useSaveLoadButtons#
useSaveLoadButtons()#
Returns a component with Save/Load buttons and all necessary dialogs
Type Parameters#
| Type Parameter | Default type |
|---|---|
TProtocol |
any |
Parameters#
| Parameter | Type |
|---|---|
config |
UseSaveLoadButtonsConfig<TProtocol> |
Returns#
() => Element
Example#
const SaveLoadButtons = useSaveLoadButtons({
entityTypeSuffix: 'pages',
methods: { save: 'save_page', load: 'load_page', list: 'list_pages' }
})
return <SaveLoadButtons />
UseSaveLoadButtonsConfig#
Extends#
Omit<SaveLoadConfig<TProtocol>,"pluginId"|"sendMessage"|"currentEntityName">
Type Parameters#
| Type Parameter | Default type |
|---|---|
TProtocol |
any |
Properties#
dialogTitles?#
Optional custom dialog titles
load?#
save?#
entityTypeSuffix?#
Custom entity type suffix (default: 'entities')
Inherited from#
SaveLoadConfig.entityTypeSuffix
labels?#
Optional custom button labels
load?#
save?#
methods?#
optional methods?: {
list?: keyof TProtocol;
load?: keyof TProtocol;
preview?: keyof TProtocol;
save?: keyof TProtocol;
};
Backend method names - type-safe against protocol interface
list?#
load?#
preview?#
save?#
Inherited from#
previewComponent?#
Optional custom preview component