@@ -7,8 +7,7 @@ import Button from '../components/common/Button';
77import { createFlightsSocket } from '../sockets/flightsSocket' ;
88import { createOverviewSocket } from '../sockets/overviewSocket' ;
99import { useData } from '../hooks/data/useData' ;
10- import { useSettings } from '../hooks/settings/useSettings' ;
11- import { linearToLogVolume , playAudioWithGain } from '../utils/playSound' ;
10+ import { useAuth } from '../hooks/auth/useAuth' ;
1211import { parseCallsign , getAirportName } from '../utils/callsignParser' ;
1312import type { Flight } from '../types/flight' ;
1413import type { OverviewSession } from '../sockets/overviewSocket' ;
@@ -43,6 +42,7 @@ export default function ACARS() {
4342 const [ isAuthError , setIsAuthError ] = useState ( false ) ;
4443 const [ pdcRequested , setPdcRequested ] = useState ( false ) ;
4544 const [ sessionAccessId , setSessionAccessId ] = useState < string | null > ( null ) ;
45+ const { user } = useAuth ( ) ;
4646 const [ notes , setNotes ] = useState < string > ( '' ) ;
4747 const [ terminalWidth , setTerminalWidth ] = useState ( 50 ) ;
4848 const [ notesWidth , setNotesWidth ] = useState ( 20 ) ;
@@ -831,27 +831,49 @@ NOTES:
831831 </ div >
832832 { session . controllers &&
833833 session . controllers . length > 0 ? (
834- < div className = "ml-2 mt-0.5 space-y-0.5" >
835- { session . controllers . map (
836- ( controller , idx ) => (
837- < div
838- key = { idx }
839- className = "text-[10px] flex items-center gap-1"
840- >
841- < span className = "text-gray-500" >
842- •
843- </ span >
844- < span className = "text-gray-300" >
845- {
846- controller . username
847- }
848- </ span >
849- < span className = "text-gray-600" >
850- ({ controller . role } )
851- </ span >
834+ < div className = "ml-2 mt-1 space-y-1" >
835+ { session . controllers . map ( ( controller , idx ) => {
836+ const isCurrentUser =
837+ ! ! user &&
838+ controller . username === user . username ;
839+ const isVatsimLinked =
840+ isCurrentUser && ! ! user ?. vatsimCid ;
841+ const hasControllerRating =
842+ isVatsimLinked &&
843+ ! ! user ?. vatsimRatingShort &&
844+ user . vatsimRatingShort !== 'OBS' ;
845+ const infoText = hasControllerRating
846+ ? 'This user holds a controller rating on VATSIM'
847+ : 'This user is registered on VATSIM' ;
848+ return (
849+ < div key = { idx } className = "" >
850+ < div className = "flex items-center gap-2" >
851+ < span className = "text-gray-400 text-base" > •</ span >
852+ < span className = "text-white text-base md:text-lg font-semibold" >
853+ { controller . username }
854+ </ span >
855+ { isVatsimLinked && (
856+ < span className = "relative group inline-flex items-center justify-center rounded-full bg-white p-0.5" >
857+ < img
858+ src = "/assets/images/vatsim.svg"
859+ alt = "VATSIM"
860+ className = "h-3 w-3"
861+ style = { { transform : 'rotate(180deg)' } }
862+ />
863+ < span
864+ className = "absolute left-full top-1/2 -translate-y-1/2 ml-2 whitespace-nowrap rounded-md px-2 py-1 text-[10px] md:text-xs font-medium text-white bg-gradient-to-r from-cyan-500 to-green-500 shadow-lg opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity duration-100"
865+ >
866+ { infoText }
867+ </ span >
868+ </ span >
869+ ) }
870+ < span className = "text-gray-500 text-sm md:text-base" >
871+ ({ controller . role } )
872+ </ span >
873+ </ div >
852874 </ div >
853- )
854- ) }
875+ ) ;
876+ } ) }
855877 </ div >
856878 ) : (
857879 < div className = "text-[10px] text-gray-500 ml-2" >
0 commit comments