mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 11:49:19 +00:00
feat: new connections page to handle multiple whats
This commit is contained in:
37
frontend/src/components/QrcodeModal/index.js
Normal file
37
frontend/src/components/QrcodeModal/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import React from "react";
|
||||
import QRCode from "qrcode.react";
|
||||
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
Paper,
|
||||
Typography,
|
||||
DialogTitle,
|
||||
} from "@material-ui/core";
|
||||
import { i18n } from "../../translate/i18n";
|
||||
|
||||
const QrcodeModal = ({ open, onClose, session }) => {
|
||||
if (session) {
|
||||
return (
|
||||
<Dialog open={open} onClose={onClose} maxWidth="lg" scroll="paper">
|
||||
<DialogTitle>{session.name}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Paper elevation={0}>
|
||||
<Typography color="primary" gutterBottom>
|
||||
{i18n.t("qrCode.message")}
|
||||
</Typography>
|
||||
{session.qrcode ? (
|
||||
<QRCode value={session.qrcode} size={256} />
|
||||
) : (
|
||||
<span>loading</span>
|
||||
)}
|
||||
</Paper>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
export default QrcodeModal;
|
||||
Reference in New Issue
Block a user