@@ -9,57 +9,26 @@ 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 ) ;
15- console . log ( 'clientDetails' , clientDetails )
1615
1716 return (
1817 < div css = { css `
1918 display : flex;
2019 flex-direction : column;
2120 gap : 32px ;
2221 ` } >
23-
24- < h4 className = "spectrum-Heading spectrum-Heading--sizeS" > { clientDetails ?. heading } </ h4 >
25-
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- } ) }
22+ < h4 className = "spectrum-Heading spectrum-Heading--sizeS" > { clientDetails ?. heading } </ h4 >
23+ { apiKeyDetails && < ReturnAPIKey returnCredentialDetails = { clientDetails } returnAPIKey = { apiKeyDetails } apiKey = { response ?. workspaces [ 0 ] ?. credentials [ 0 ] ?. clientId } /> }
24+ { allowedOrigins && < ReturnAllowedOrigins returnCredentialDetails = { clientDetails } allowedOrigins = { allowedOriginsDetails } returnAllowedOrigins = { allowedOrigins } /> }
25+ { clientIdDetails && < ReturnClientId returnCredentialDetails = { clientDetails } returnClientId = { clientIdDetails } clientId = { response ?. workspaces [ 0 ] ?. credentials [ 0 ] ?. clientId } /> }
26+ { clientSecretDetails && < ReturnClientSecret returnCredentialDetails = { clientDetails } returnClientSecret = { clientSecretDetails } response = { response } /> }
27+ { organizationDetails && < ReturnOrganizationName returnCredentialDetails = { clientDetails } returnOrganizationName = { organizationDetails } organization = { organizationName ?. name } /> }
28+ { scopesDetails && < ReturnScopes returnCredentialDetails = { clientDetails } returnScopes = { scopesDetails } /> }
29+ { imsOrgID && < CardImsOrgID returnCredentialDetails = { clientDetails } cardImsOrgID = { imsOrgID } imsOrgId = { selectedOrganization ?. code } /> }
6030 </ div >
6131 )
6232}
6333
6434export { ReturnCredentialDetails } ;
65-
0 commit comments