import wn from '../../../../../node_modules/preact/compat/dist/compat.module.mjs';
import { FlexBox } from '../shared/components/FlexBox.mjs';
import { SCIMFields } from '../components/ScimFields.mjs';
import { getSCIMIdpInfo, getFieldBy, DEFAULT_BASE_URL_LABEL } from './scimInfo.mjs';
import { useMemo as F } from '../../../../../node_modules/preact/hooks/dist/hooks.module.mjs';

const DetailsSection$1 = ({ connection })=>{
    const { displayName } = getSCIMIdpInfo(connection.identity_provider);
    const detailsFields = F(()=>{
        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__*/ wn.createElement(FlexBox, {
        flexDirection: "column",
        gap: 2
    }, /*#__PURE__*/ wn.createElement(SCIMFields, {
        connection: connection,
        fields: detailsFields
    }));
};

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