import React, { FC, useCallback, useState } from 'react'; import { Button, Field, Form, HorizontalGroup, Input } from '@grafana/ui'; import { RepeatRowSelect } from '../RepeatRowSelect/RepeatRowSelect'; export type OnRowOptionsUpdate = (title: string | null, repeat: string | null | undefined) => void; export interface Props { title: string | null; 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) => setNewRepeat(name), [setNewRepeat]); return (
{ onUpdate(formData.title, newRepeat); }} > {({ register }) => ( <> )}
); };