2022-04-22 14:33:13 +01:00
|
|
|
import { css } from '@emotion/css';
|
2023-03-14 07:38:21 -07:00
|
|
|
import React from 'react';
|
2022-04-22 14:33:13 +01:00
|
|
|
|
2020-06-04 13:44:48 +02:00
|
|
|
import { Modal, stylesFactory } from '@grafana/ui';
|
|
|
|
|
|
|
|
|
|
import { OnRowOptionsUpdate, RowOptionsForm } from './RowOptionsForm';
|
|
|
|
|
|
|
|
|
|
export interface RowOptionsModalProps {
|
2021-07-20 09:57:03 +01:00
|
|
|
title: string;
|
|
|
|
|
repeat?: string | null;
|
2020-06-04 13:44:48 +02:00
|
|
|
onDismiss: () => void;
|
|
|
|
|
onUpdate: OnRowOptionsUpdate;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-14 07:38:21 -07:00
|
|
|
export const RowOptionsModal = ({ repeat, title, onDismiss, onUpdate }: RowOptionsModalProps) => {
|
2020-06-04 13:44:48 +02:00
|
|
|
const styles = getStyles();
|
|
|
|
|
return (
|
2021-04-01 08:42:57 -07:00
|
|
|
<Modal isOpen={true} title="Row options" icon="copy" onDismiss={onDismiss} className={styles.modal}>
|
2020-06-04 13:44:48 +02:00
|
|
|
<RowOptionsForm repeat={repeat} title={title} onCancel={onDismiss} onUpdate={onUpdate} />
|
|
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getStyles = stylesFactory(() => {
|
|
|
|
|
return {
|
|
|
|
|
modal: css`
|
|
|
|
|
label: RowOptionsModal;
|
|
|
|
|
width: 500px;
|
|
|
|
|
`,
|
|
|
|
|
};
|
|
|
|
|
});
|