(
<>
{whatsApp.status === "qrcode" && (
)}
{whatsApp.status === "DISCONNECTED" && (
<>
{" "}
>
)}
{(whatsApp.status === "CONNECTED" ||
whatsApp.status === "PAIRING" ||
whatsApp.status === "TIMEOUT") && (
)}
{whatsApp.status === "OPENING" && (
)}
>
)}
/>
);
};
const renderStatusToolTips = whatsApp => {
return (
{whatsApp.status === "DISCONNECTED" && (
)}
{whatsApp.status === "OPENING" && (
)}
{whatsApp.status === "qrcode" && (
)}
{whatsApp.status === "CONNECTED" && (
)}
{(whatsApp.status === "TIMEOUT" || whatsApp.status === "PAIRING") && (
)}
);
};
return (
(
{confirmModalInfo.message}
{i18n.t("connections.title")}
(
)}
/>
{i18n.t("connections.table.name")}
{i18n.t("connections.table.status")}
(
{i18n.t("connections.table.session")}
)}
/>
{i18n.t("connections.table.lastUpdate")}
{i18n.t("connections.table.default")}
{i18n.t("connections.table.actions")}
{loading ? (
) : (
<>
{whatsApps?.length > 0 &&
whatsApps.map(whatsApp => (
{whatsApp.name}
{renderStatusToolTips(whatsApp)}
(
{renderActionButtons(whatsApp)}
)}
/>
{format(parseISO(whatsApp.updatedAt), "dd/MM/yy HH:mm")}
{whatsApp.isDefault && (
)}
handleEditWhatsApp(whatsApp)}
>
(
{
handleOpenConfirmationModal("delete", whatsApp.id);
}}
>
)}
/>
))}
>
)}
)}
/>
);
};
export default Connections;