@@ -9,26 +9,57 @@ 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 )
1516
1617 return (
1718 < div css = { css `
1819 display : flex;
1920 flex-direction : column;
2021 gap : 32px ;
2122 ` } >
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 } /> }
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+ } ) }
3060 </ div >
3161 )
3262}
3363
3464export { ReturnCredentialDetails } ;
65+
0 commit comments