@@ -171,7 +171,7 @@ function Diagnostics({ client, onNavigate, docsBase }: DiagnosticsProps) {
171171 const theme = useTheme ( ) ;
172172 const isMobile = useMediaQuery ( theme . breakpoints . down ( 'md' ) ) ;
173173 const isSmallMobile = useMediaQuery ( theme . breakpoints . down ( 'sm' ) ) ;
174- const { active , registry } = useTraits ( ) ;
174+ const { outboundTraits , inboundTraits } = useTraits ( ) ;
175175
176176 // const hrefFor = (topic: string): string | undefined => (anchors[topic] || thirdParty[topic]);
177177
@@ -571,16 +571,17 @@ function Diagnostics({ client, onNavigate, docsBase }: DiagnosticsProps) {
571571
572572 const { checks } = diagnostics ;
573573
574- if ( active ?. outbound === 'phaxio' ) {
575- const phaxio = checks . phaxio || { } ;
574+ // Provider‑specific guidance based on available diagnostics keys
575+ if ( ( checks as any ) . phaxio ) {
576+ const phaxio = ( checks as any ) . phaxio || { } ;
576577 if ( ! phaxio . api_key_set ) suggestions . push ( { type : 'error' , text : 'Set PHAXIO_API_KEY in .env' } ) ;
577578 if ( ! phaxio . api_secret_set ) suggestions . push ( { type : 'error' , text : 'Set PHAXIO_API_SECRET in .env' } ) ;
578579 if ( ! phaxio . callback_url_set ) suggestions . push ( { type : 'warning' , text : 'Set PHAXIO_STATUS_CALLBACK_URL (or PHAXIO_CALLBACK_URL)' } ) ;
579580 if ( phaxio . public_url_https === false ) suggestions . push ( { type : 'warning' , text : 'Use HTTPS for PUBLIC_API_URL' } ) ;
580581 }
581-
582- if ( active ?. outbound === ' sip' ) {
583- const sip = checks . sip || { } ;
582+
583+ if ( ( checks as any ) . sip ) {
584+ const sip = ( checks as any ) . sip || { } ;
584585 if ( sip . ami_password_not_default === false ) suggestions . push ( { type : 'error' , text : 'Change ASTERISK_AMI_PASSWORD from default "changeme"' } ) ;
585586 if ( sip . ami_reachable === false ) suggestions . push ( { type : 'error' , text : 'Verify Asterisk AMI host/port/credentials and network reachability' } ) ;
586587 }
@@ -972,31 +973,20 @@ function Diagnostics({ client, onNavigate, docsBase }: DiagnosticsProps) {
972973 < Stack spacing = { 2 } >
973974 < Box >
974975 < Typography variant = "subtitle2" fontWeight = { 600 } sx = { { mb : 1 } } >
975- Active Providers
976+ Active Providers (traits)
977+ </ Typography >
978+ < Typography variant = "caption" color = "text.secondary" >
979+ Displaying traits for the active outbound and inbound providers.
976980 </ Typography >
977- < Box sx = { { display : 'flex' , gap : 1 , flexWrap : 'wrap' } } >
978- < Chip
979- label = { `Outbound: ${ active ?. outbound || 'None' } ` }
980- color = "primary"
981- variant = "outlined"
982- sx = { { borderRadius : 1 } }
983- />
984- < Chip
985- label = { `Inbound: ${ active ?. inbound || 'None' } ` }
986- color = "secondary"
987- variant = "outlined"
988- sx = { { borderRadius : 1 } }
989- />
990- </ Box >
991981 </ Box >
992982
993- { active ?. outbound && registry ?. [ active . outbound ] ?. traits && (
983+ { outboundTraits && (
994984 < Box >
995985 < Typography variant = "subtitle2" fontWeight = { 600 } sx = { { mb : 1 } } >
996986 Outbound Traits
997987 </ Typography >
998988 < Box sx = { { display : 'flex' , gap : 0.5 , flexWrap : 'wrap' } } >
999- { Object . entries ( registry [ active . outbound ] . traits || { } ) . map ( ( [ key , value ] ) => (
989+ { Object . entries ( outboundTraits || { } ) . map ( ( [ key , value ] ) => (
1000990 < Chip
1001991 key = { key }
1002992 label = { `${ key } : ${ String ( value ) } ` }
@@ -1010,13 +1000,13 @@ function Diagnostics({ client, onNavigate, docsBase }: DiagnosticsProps) {
10101000 </ Box >
10111001 ) }
10121002
1013- { active ?. inbound && registry ?. [ active . inbound ] ?. traits && active . inbound !== active . outbound && (
1003+ { inboundTraits && (
10141004 < Box >
10151005 < Typography variant = "subtitle2" fontWeight = { 600 } sx = { { mb : 1 } } >
10161006 Inbound Traits
10171007 </ Typography >
10181008 < Box sx = { { display : 'flex' , gap : 0.5 , flexWrap : 'wrap' } } >
1019- { Object . entries ( registry [ active . inbound ] . traits || { } ) . map ( ( [ key , value ] ) => (
1009+ { Object . entries ( inboundTraits || { } ) . map ( ( [ key , value ] ) => (
10201010 < Chip
10211011 key = { key }
10221012 label = { `${ key } : ${ String ( value ) } ` }
0 commit comments