import React, { useState, FormEvent, useEffect, useContext } from "react"; import { FormGroup, Form, Select, SelectVariant, SelectOption, } from "@patternfly/react-core"; import { HttpClientContext } from "../../http-service/HttpClientContext"; import { sortProvider } from "../../util"; import { ServerInfoRepresentation } from "../../model/server-info"; import { ClientRepresentation } from "../../model/client-model"; import { ClientDescription } from "./ClientDescription"; type Step1Props = { onChange: (value: string, event: FormEvent) => void; client: ClientRepresentation; }; export const Step1 = ({ client, onChange }: Step1Props) => { const httpClient = useContext(HttpClientContext)!; const [providers, setProviders] = useState([]); const [open, isOpen] = useState(false); useEffect(() => { (async () => { const response = await httpClient.doGet( "/admin/serverinfo" ); const providers = Object.entries( response.data!.providers["login-protocol"].providers ); setProviders(["", ...new Map(providers.sort(sortProvider)).keys()]); })(); }, []); return (
); };