feature/IO-3000-messaging-sockets-migrations2 -
- Fix Chat Icon logger error - Fix Socket Robustness - added additional wss status for error - Installed ant-design icons Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -1,18 +1,33 @@
|
||||
import { connect } from "react-redux";
|
||||
import { GlobalOutlined } from "@ant-design/icons";
|
||||
import { GlobalOutlined, WarningOutlined } from "@ant-design/icons";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import React from "react";
|
||||
import { selectWssStatus } from "../../redux/application/application.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
wssStatus: selectWssStatus
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(WssStatusDisplay);
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({});
|
||||
|
||||
export function WssStatusDisplay({ wssStatus }) {
|
||||
console.log("🚀 ~ WssStatusDisplay ~ wssStatus:", wssStatus);
|
||||
return <GlobalOutlined style={{ color: wssStatus === "connected" ? "green" : "red", marginRight: ".5rem" }} />;
|
||||
|
||||
let icon;
|
||||
let color;
|
||||
|
||||
if (wssStatus === "connected") {
|
||||
icon = <GlobalOutlined />;
|
||||
color = "green";
|
||||
} else if (wssStatus === "error") {
|
||||
icon = <WarningOutlined />;
|
||||
color = "red";
|
||||
} else {
|
||||
icon = <GlobalOutlined />;
|
||||
color = "gray"; // Default for other statuses like "disconnected"
|
||||
}
|
||||
|
||||
return <span style={{ color, marginRight: ".5rem" }}>{icon}</span>;
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(WssStatusDisplay);
|
||||
|
||||
Reference in New Issue
Block a user