import React, { Fragment, useState } from "react"; import { useTranslation } from "react-i18next"; import { Alert, Button, ButtonVariant, Divider, Form, FormGroup, Modal, Radio, Switch, } from "@patternfly/react-core"; import type ResourceServerRepresentation from "@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation"; import { JsonFileUpload } from "../../components/json-file-upload/JsonFileUpload"; import { HelpItem } from "../../components/help-enabler/HelpItem"; type ImportDialogProps = { onConfirm: (value: ResourceServerRepresentation) => void; closeDialog: () => void; }; export const ImportDialog = ({ onConfirm, closeDialog }: ImportDialogProps) => { const { t } = useTranslation("clients"); const [imported, setImported] = useState({}); return ( { onConfirm(imported); closeDialog(); }} data-testid="confirm" > {t("confirm")} , , ]} >
{Object.keys(imported).length !== 0 && ( <>

{t("importResources")}

} fieldId="policyEnforcementMode" hasNoPaddingTop > } fieldId="decisionStrategy" hasNoPaddingTop > } >
{Object.entries(imported) .filter(([, value]) => Array.isArray(value)) .map(([key, value]) => (

{value.length} {t(key)}

))}
)}
); };