import { IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonCardTitle, IonCol, IonContent, IonGrid, IonHeader, IonIcon, IonNote, IonPage, IonRow, IonTitle, IonToolbar, useIonToast, } from '@ionic/react'; import QRCode from 'react-qr-code'; import { addQRCode } from '../store/QRStore'; import useSound from 'use-sound'; import closeSound from '../sounds/close.wav'; import { reloadOutline } from 'ionicons/icons'; export const QRCodeScannedModal = ({ dismiss, code, set, scan }) => { const [play] = useSound(closeSound); const [showToast] = useIonToast(); const handleDismiss = () => { dismiss(); play(); }; const handleScanAgain = () => { handleDismiss(); setTimeout(() => { scan(); }, 10); }; const handleAdd = async () => { addQRCode(code.text ? code.text : code, true); showToast({ header: 'Success!', message: 'QR Code stored successfully.', duration: 3000, color: 'primary', }); handleDismiss(); }; return ( View QR Code Close QR Code data This is what the code represents

{code.text ? code.text : code}

  Scan again Store →
); };