import {ReactElement, ReactEventHandler, useState} from "react"; import "../../styles/notificationConnector.css"; import Loader from "../Loader"; import NotificationConnector from "../api/NotificationConnector"; import INotificationConnector from "../types/INotificationConnector"; import {GotifyItem} from "./Gotify"; import {NtfyItem} from "./Ntfy"; import {LunaseaItem} from "./Lunasea"; import {PushoverItem} from "./Pushover"; export default function NotificationConnectorItem({apiUri, notificationConnector} : {apiUri: string, notificationConnector: INotificationConnector | null}) : ReactElement { if(notificationConnector != null) return const [selectedConnectorElement, setSelectedConnectorElement] = useState(); return
New Notification Connector
{selectedConnectorElement}
; } function DefaultItem({apiUri, notificationConnector}:{apiUri: string, notificationConnector: INotificationConnector | null}) : ReactElement { const AddHeader : ReactEventHandler = () => { let header : Record = {}; let x = info; x.headers = [header, ...x.headers]; setInfo(x); setHeaderElements([...headerElements, ]) } const [headerElements, setHeaderElements] = useState([]); const [info, setInfo] = useState({ name: "", url: "", headers: [], httpMethod: "", body: "" }); const [loading, setLoading] = useState(false); return
setInfo({...info, name: e.currentTarget.value})} />
setInfo({...info, url: e.currentTarget.value})} />