@@ -9,7 +9,7 @@ import { ReturnScopes } from './ReturnScopes';
99import GetCredentialContext from '../GetCredentialContext' ;
1010import { CardImsOrgID } from '../Card/CardImsOrgID' ;
1111
12- const ReturnCredentialDetails = ( { clientDetails, clientIdDetails, clientSecretDetails, organizationDetails, scopesDetails, apiKeyDetails, allowedOriginsDetails, organizationName, allowedOrigins, response, imsOrgID} ) => {
12+ const ReturnCredentialDetails = ( { clientDetails, clientIdDetails, clientSecretDetails, organizationDetails, scopesDetails, apiKeyDetails, allowedOriginsDetails, organizationName, allowedOrigins, response, imsOrgID } ) => {
1313
1414 const { selectedOrganization } = useContext ( GetCredentialContext ) ;
1515 console . log ( 'clientDetails' , clientDetails )
@@ -20,46 +20,18 @@ const ReturnCredentialDetails = ({ clientDetails, clientIdDetails, clientSecretD
2020 flex-direction : column;
2121 gap : 32px ;
2222 ` } >
23-
24- < h4 className = "spectrum-Heading spectrum-Heading--sizeS" > { clientDetails ?. heading } </ h4 >
2523
26- { clientDetails . children . map ( ( element ) => {
27- switch ( element ?. type ?. name ) {
28- case "ReturnAllowedOrigins" :
29- return (
30- < ReturnAllowedOrigins returnCredentialDetails = { clientDetails } allowedOrigins = { allowedOriginsDetails } returnAllowedOrigins = { allowedOrigins } />
31- ) ;
32- case "ReturnOrganizationName" :
33- return (
34- < ReturnOrganizationName returnCredentialDetails = { clientDetails } returnOrganizationName = { organizationDetails } organization = { organizationName ?. name } />
35- ) ;
36- case "CardImsOrgID" :
37- return (
38- < CardImsOrgID returnCredentialDetails = { clientDetails } cardImsOrgID = { imsOrgID } imsOrgId = { selectedOrganization ?. code } />
39- ) ;
40- case "ReturnAPIKey" :
41- return (
42- < ReturnAPIKey returnCredentialDetails = { clientDetails } returnAPIKey = { apiKeyDetails } apiKey = { response ?. workspaces [ 0 ] ?. credentials [ 0 ] ?. clientId } />
43- ) ;
44- case "ReturnClientId" :
45- return (
46- < ReturnClientId returnCredentialDetails = { clientDetails } returnClientId = { clientIdDetails } clientId = { response ?. workspaces [ 0 ] ?. credentials [ 0 ] ?. clientId } />
47- ) ;
48- case "ReturnClientSecret" :
49- return (
50- < ReturnClientSecret returnCredentialDetails = { clientDetails } returnClientSecret = { clientSecretDetails } response = { response } />
51- ) ;
52- case "ReturnScopes" :
53- return (
54- < ReturnScopes returnCredentialDetails = { clientDetails } returnScopes = { scopesDetails } />
55- ) ;
56- default :
57- return null ;
58- }
59- } ) }
24+ < h4 className = "spectrum-Heading spectrum-Heading--sizeS" > { clientDetails ?. heading } </ h4 >
25+
26+ { apiKeyDetails && < ReturnAPIKey returnCredentialDetails = { clientDetails } returnAPIKey = { apiKeyDetails } apiKey = { response ?. workspaces [ 0 ] ?. credentials [ 0 ] ?. clientId } /> }
27+ { allowedOrigins && < ReturnAllowedOrigins returnCredentialDetails = { clientDetails } allowedOrigins = { allowedOriginsDetails } returnAllowedOrigins = { allowedOrigins } /> }
28+ { clientIdDetails && < ReturnClientId returnCredentialDetails = { clientDetails } returnClientId = { clientIdDetails } clientId = { response ?. workspaces [ 0 ] ?. credentials [ 0 ] ?. clientId } /> }
29+ { clientSecretDetails && < ReturnClientSecret returnCredentialDetails = { clientDetails } returnClientSecret = { clientSecretDetails } response = { response } /> }
30+ { organizationDetails && < ReturnOrganizationName returnCredentialDetails = { clientDetails } returnOrganizationName = { organizationDetails } organization = { organizationName ?. name } /> }
31+ { scopesDetails && < ReturnScopes returnCredentialDetails = { clientDetails } returnScopes = { scopesDetails } /> }
32+ { imsOrgID && < CardImsOrgID returnCredentialDetails = { clientDetails } cardImsOrgID = { imsOrgID } imsOrgId = { selectedOrganization ?. code } /> }
6033 </ div >
6134 )
6235}
6336
6437export { ReturnCredentialDetails } ;
65-
0 commit comments