import React, { FC, useCallback, useState } from 'react'; import { Button, Field, Form, Modal, Input } from '@grafana/ui'; import { RepeatRowSelect } from '../RepeatRowSelect/RepeatRowSelect'; export type OnRowOptionsUpdate = (title: string, repeat?: string | null) => void; export interface Props { title: string; repeat?: string | null; onUpdate: OnRowOptionsUpdate; onCancel: () => void; } export const RowOptionsForm: FC = ({ repeat, title, onUpdate, onCancel }) => { const [newRepeat, setNewRepeat] = useState(repeat); const onChangeRepeat = useCallback((name?: string | null) => setNewRepeat(name), [setNewRepeat]); return (
{ onUpdate(formData.title, newRepeat); }} > {({ register }) => ( <> )}
); };