import React__default, { useMemo } from 'react';
import { FlexBox } from '../shared/components/FlexBox.mjs';
import { SCIMFields } from '../components/ScimFields.mjs';
import { getSCIMIdpInfo, getFieldBy, DEFAULT_BASE_URL_LABEL } from './scimInfo.mjs';

const DetailsSection$1 = ({ connection })=>{
    const { displayName } = getSCIMIdpInfo(connection.identity_provider);
    const detailsFields = useMemo(()=>{
        const baseUrlField = getFieldBy({
            idp: connection.identity_provider,
            key: 'base_url'
        }) ?? {
            label: DEFAULT_BASE_URL_LABEL,
            value: connection.base_url,
            isCopyable: true
        };
        return [
            {
                label: 'SCIM Connection Display Name',
                scimConnectionKey: 'display_name'
            },
            {
                label: 'IdP',
                value: displayName
            },
            baseUrlField
        ];
    }, [
        connection.base_url,
        connection.identity_provider,
        displayName
    ]);
    return /*#__PURE__*/ React__default.createElement(FlexBox, {
        flexDirection: "column",
        gap: 2
    }, /*#__PURE__*/ React__default.createElement(SCIMFields, {
        connection: connection,
        fields: detailsFields
    }));
};

export { DetailsSection$1 as DetailsSection };
//# sourceMappingURL=SCIMConnectionDetailsSection.mjs.map
