import React from "react"; import { useTranslation } from "react-i18next"; import { Modal, ModalVariant, TextContent, Text, TextVariants, } from "@patternfly/react-core"; import { TableComposable, Tbody, Td, Th, Thead, Tr, } from "@patternfly/react-table"; import type PolicyProviderRepresentation from "@keycloak/keycloak-admin-client/lib/defs/policyProviderRepresentation"; type NewPolicyDialogProps = { policyProviders?: PolicyProviderRepresentation[]; toggleDialog: () => void; onSelect: (provider: PolicyProviderRepresentation) => void; }; export const NewPolicyDialog = ({ policyProviders, onSelect, toggleDialog, }: NewPolicyDialogProps) => { const { t } = useTranslation("clients"); return ( {t("chooseAPolicyType")} {t("chooseAPolicyTypeInstructions")} } isOpen onClose={toggleDialog} > {t("common:name")} {t("common:description")} {policyProviders?.map((provider) => ( onSelect(provider)} isHoverable > {provider.name} {t(`policyProvider.${provider.type}`)} ))} ); };