import styles from './ConfigurationForm.module.css'; import Block from '../../../GBlock/Block'; import Text from '../../../Text/Text'; import PluginState from '../../../../plugin_state'; import { Button, Field, Form, Input } from '@grafana/ui'; import cn from 'classnames/bind'; import { SubmitHandler } from 'react-hook-form'; import React, { FC, useCallback, useState } from 'react'; import { isEmpty } from 'lodash-es'; const cx = cn.bind(styles); type Props = { onSuccessfulSetup: () => void; defaultDataExporterApiUrl: string; }; type FormProps = { dataExporterApiUrl: string; }; /** * https://stackoverflow.com/a/43467144 */ const isValidUrl = (url: string): boolean => { try { new URL(url); return true; } catch (_) { return false; } }; const FormErrorMessage: FC<{ errorMsg: string }> = ({ errorMsg }) => ( <>
{errorMsg}