JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE HTML>
<html>
    
    <head>
        <title>Test Interactive Office Schematic</title>
        <style>
            html, body {
                margin: 0px;
                padding: 0px;
            }
        </style>
    </head>
    
    <body>
        <script>
            function addOffice(type, id, occupentName) { 

                var canvas = document.createElement('canvas');
                canvas.id = id;
                canvas.style.position = "absolute";
                canvas.style.left = "20px";
                canvas.style.class = "office";
                var context = canvas.getContext('2d');
                context.beginPath();
                context.moveTo(0, 0);
                if (type == 1) {
                    canvas.width = 80;
                    canvas.height = 80;
                    context.lineTo(2, 0);
                    context.lineTo(2, 20);
                    context.quadraticCurveTo(22, 20, 22, 0);
                    context.lineTo(60, 0);
                    context.lineTo(60, 80);
                    context.lineTo(0, 80);
                    context.lineTo(0, 0);
                }
                context.lineWidth = 2;
                context.strokeStyle = 'black';
                context.stroke();
                context.textBaseline = "Alphabetic";
                context.textAlign = "center";
                context.fillText(occupentName, canvas.width / 2, canvas.height / 2);
                document.body.appendChild(canvas);
                canvas = document.getElementById("1");
                context = canvas.getContext('2d');
                var tempCanvas = document.createElement("canvas"),
                    tempCtx = tempCanvas.getContext("2d");
                tempCanvas.width = canvas.width;
                tempCanvas.height = canvas.height;
                tempCtx.drawImage(canvas, 0, 0, canvas.width, canvas.height);
                context.clearRect(0, 0, canvas.width, canvas.height);
               ...