import React, { useState, useEffect } from "react"; import QRCodeWithBackground from "./QR"; // Adjust path as needed const TableList = ({ shop, tables, onSelectTable, selectedTable }) => { const [initialPos, setInitialPos] = useState({ left: shop.xposition, top: shop.yposition, }); const [initialSize, setInitialSize] = useState(shop.scale); const [bgImageUrl, setBgImageUrl] = useState(shop.qrBackground); const shopUrl = window.location.hostname + "/" + shop.cafeId; const generateQRCodeUrl = (tableCode) => `https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent( shopUrl + "/" + tableCode )}`; const handleBackgroundUrlChange = (newUrl) => { setBgImageUrl(newUrl); }; const handleQrSave = (qrPosition, qrSize, bgImage) => { setInitialPos(qrPosition); setInitialSize(qrSize); setBgImageUrl(bgImage); }; return (
); }; export default TableList;