import { faBan } from "@fortawesome/free-solid-svg-icons"; import { EyeIcon } from "lucide-react"; import { EmptyState, Spinner, Tooltip } from "@app/components/v2"; import { Badge } from "@app/components/v3"; import { useClearIdentityLdapAuthLockouts, useGetIdentityLdapAuth } from "@app/hooks/api"; import { IdentityLdapAuthForm } from "@app/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityLdapAuthForm"; import { ViewIdentityContentWrapper } from "@app/pages/organization/IdentityDetailsByIDPage/components/ViewIdentityAuthModal/ViewIdentityContentWrapper"; import { IdentityAuthFieldDisplay } from "./IdentityAuthFieldDisplay"; import { LockoutFields } from "./IdentityAuthLockoutFields"; import { ViewAuthMethodProps } from "./types"; export const ViewIdentityLdapAuthContent = ({ identityId, handlePopUpToggle, handlePopUpOpen, onDelete, popUp, lockedOut, onResetAllLockouts }: ViewAuthMethodProps) => { const { data, isPending } = useGetIdentityLdapAuth(identityId); const clearLockoutsResult = useClearIdentityLdapAuthLockouts(); if (isPending) { return (
); } if (!data) { return ( ); } if (popUp.identityAuthMethod.isOpen) { return ( ); } return ( handlePopUpOpen("identityAuthMethod")} onDelete={onDelete} > {data.accessTokenTTL} {data.accessTokenMaxTTL} {data.accessTokenNumUsesLimit} {data.accessTokenTrustedIps.map((ip) => ip.ipAddress).join(", ")} {data.url} {data.bindDN} {data.bindPass}

} > Reveal
{data.searchBase} {data.searchFilter} {data.ldapCaCertificate && ( {data.ldapCaCertificate}

} > Reveal
)}
{data.lockoutEnabled ? "Enabled" : "Disabled"} {data.lockoutEnabled && ( )}
); };