diff --git a/src/containers/internal/views/carriers/form.tsx b/src/containers/internal/views/carriers/form.tsx index f933f28..4e30976 100644 --- a/src/containers/internal/views/carriers/form.tsx +++ b/src/containers/internal/views/carriers/form.tsx @@ -1408,202 +1408,164 @@ export const CarrierForm = ({
- {trunkType === "reg" ? ( - // For registration trunk, show fields directly without checkzone -
-
Authentication
- - Registration trunk requires authentication credentials. - - - { - setSipUser(e.target.value); - }} - /> - - { - setSipPass(e.target.value); - }} - /> -
- ) : ( - - )} + {/* Authentication Fields - shared component */} + {(() => { + const authFields = ( + <> + + 0 + } + onChange={(e) => setSipUser(e.target.value)} + /> + + 0 + } + onChange={(e) => setSipPass(e.target.value)} + /> + + ); + + if (trunkType === "reg") { + return ( +
+
Authentication
+ + Registration trunk requires authentication credentials. + + {authFields} +
+ ); + } else { + return ( + + ); + } + })()}
- {trunkType === "reg" ? ( - // For registration trunk, show fields directly without checkzone -
-
SIP Registration
- - Registration trunk requires SIP registration settings. - - - setSipRealm(e.target.value)} - /> - - setFromUser(e.target.value)} - /> - - setFromDomain(e.target.value)} - /> - -
- ) : ( - - )} + + setFromDomain(e.target.value)} + /> + + + ); + + if (trunkType === "reg") { + return ( +
+
SIP Registration
+ + Registration trunk requires SIP registration settings. + + {sipRegFields} +
+ ); + } else { + return ( + + ); + } + })()}