@@ -25,6 +25,7 @@ import org.datepollsystems.waiterrobot.mediator.ui.common.SelectedEnvironmentInf
2525import org.jetbrains.compose.resources.stringResource
2626import java.time.format.DateTimeFormatter
2727
28+ @OptIn(ExperimentalMaterial3Api ::class )
2829@Composable
2930fun MainScreen (vm : MainScreenViewModel ) {
3031 val state = vm.state.collectAsState().value
@@ -38,16 +39,31 @@ fun MainScreen(vm: MainScreenViewModel) {
3839 verticalAlignment = Alignment .CenterVertically
3940 ) {
4041 Text (
41- text = " Running... " ,
42+ text = stringResource( Res .string.main_running) ,
4243 modifier = Modifier .weight(1f ),
4344 textAlign = TextAlign .Center ,
4445 )
4546
46- Icon (
47- if (isConnected) Icons .Filled .Wifi else Icons .Filled .WifiOff ,
48- contentDescription = " Socket Connected" ,
49- modifier = Modifier .padding(horizontal = 10 .dp)
50- )
47+ val tooltipPosition = TooltipDefaults .rememberPlainTooltipPositionProvider()
48+ val tooltipState = rememberTooltipState()
49+
50+ TooltipBox (
51+ positionProvider = tooltipPosition,
52+ state = tooltipState,
53+ tooltip = {
54+ Text (
55+ stringResource(
56+ if (isConnected) Res .string.main_connected else Res .string.main_lost_connection
57+ )
58+ )
59+ }
60+ ) {
61+ Icon (
62+ if (isConnected) Icons .Filled .Wifi else Icons .Filled .WifiOff ,
63+ contentDescription = " Socket Connected" ,
64+ modifier = Modifier .padding(horizontal = 10 .dp)
65+ )
66+ }
5167 }
5268 HorizontalDivider (thickness = 3 .dp)
5369
0 commit comments