RowOptionsModal.tsx 840 B

12345678910111213141516171819202122232425262728293031
  1. import { css } from '@emotion/css';
  2. import React, { FC } from 'react';
  3. import { Modal, stylesFactory } from '@grafana/ui';
  4. import { OnRowOptionsUpdate, RowOptionsForm } from './RowOptionsForm';
  5. export interface RowOptionsModalProps {
  6. title: string;
  7. repeat?: string | null;
  8. onDismiss: () => void;
  9. onUpdate: OnRowOptionsUpdate;
  10. }
  11. export const RowOptionsModal: FC<RowOptionsModalProps> = ({ repeat, title, onDismiss, onUpdate }) => {
  12. const styles = getStyles();
  13. return (
  14. <Modal isOpen={true} title="Row options" icon="copy" onDismiss={onDismiss} className={styles.modal}>
  15. <RowOptionsForm repeat={repeat} title={title} onCancel={onDismiss} onUpdate={onUpdate} />
  16. </Modal>
  17. );
  18. };
  19. const getStyles = stylesFactory(() => {
  20. return {
  21. modal: css`
  22. label: RowOptionsModal;
  23. width: 500px;
  24. `,
  25. };
  26. });