mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Grafana-UI: Expand ConfirmModal docs (#27541)
This commit is contained in:
parent
1983de962c
commit
126683929c
@ -7,4 +7,18 @@ import { ConfirmModal } from './ConfirmModal';
|
||||
|
||||
Used to request user for action confirmation, e.g. deleting items. Triggers provided 'onConfirm' callback.
|
||||
|
||||
# Usage
|
||||
```jsx
|
||||
<ConfirmModal
|
||||
isOpen={false}
|
||||
title='Delete user'
|
||||
body='Are you sure you want to delete this user?'
|
||||
confirmText='Confirm'
|
||||
icon='exclamation-triangle'
|
||||
onConfirm={() => console.log('Confirm action')}
|
||||
onDismiss={() => console.log('Dismiss action')}
|
||||
/>
|
||||
```
|
||||
|
||||
|
||||
<Props of={ConfirmModal} />
|
||||
|
@ -8,13 +8,21 @@ import { GrafanaTheme } from '@grafana/data';
|
||||
import { HorizontalGroup } from '..';
|
||||
|
||||
export interface Props {
|
||||
/** Toggle modal's open/closed state */
|
||||
isOpen: boolean;
|
||||
/** Title for the modal header */
|
||||
title: string;
|
||||
/** Modal content */
|
||||
body: React.ReactNode;
|
||||
/** Text for confirm button */
|
||||
confirmText: string;
|
||||
/** Text for dismiss button */
|
||||
dismissText?: string;
|
||||
/** Icon for the modal header */
|
||||
icon?: IconName;
|
||||
/** Confirm action callback */
|
||||
onConfirm(): void;
|
||||
/** Dismiss action callback */
|
||||
onDismiss(): void;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user