import {ReactElement, ReactEventHandler, useState} from "react"; import "../../styles/notificationConnector.css"; import Loader from "../Loader"; import NotificationConnectorFunctions from "../NotificationConnectorFunctions"; export default interface INotificationConnector { name: string; url: string; headers: Record[]; httpMethod: string; body: string; } export function NotificationConnectorItem({apiUri, notificationConnector} : {apiUri: string, notificationConnector: INotificationConnector | null}) : ReactElement { const AddHeader : ReactEventHandler = (e) => { let header : Record = {}; let x = info; x.headers = [header, ...x.headers]; setInfo(x); setHeaderElements([...headerElements, ]) } const [headerElements, setHeaderElements] = useState([]); const [loading, setLoading] = useState(false); const [info, setInfo] = useState({ name: "", url: "", headers: [], httpMethod: "", body: "" }); return (

{notificationConnector ? notificationConnector.name : "New Notification Connector"}

{ let x = info; x.url = e.currentTarget.value; setInfo(x); }} />