How to use two renderCell in datagrid from material ui and avoid double/same render

I use material ui to render my data in table form.

I have to use renderCell for two properties (level by user and level by referent)

problem: material ui shows me ‘level by referent’ twice because it replaces ‘level by user’ with ‘level by referent’.

the tab with the two columns

    import React from 'react';
    import { useSelector } from 'react-redux';
    import { TableReusable } from '../../reusable/TableReusable';
    import { Box, CircularProgress, Typography } from '@mui/material';
    import useLevelToLetterConversion from '../../reusable/UseLevelConverter';
    
    const TcgTable = () => {
      const oneUserSkill = useSelector((state) => state.user?.oneUserSkill);
    
      const rows = oneUserSkill?.skills?.tcg;
      const convertedRows = useLevelToLetterConversion(rows);
    
      let columns =
        convertedRows?.length > 0
          ? [    {
            headerName: 'Level by user',
            headerAlign: 'center',
            align: 'center',
            renderCell: (convertedRows) => {
              const userLevel = convertedRows?.row?.Level?.find(
                (level) => level?.Role === 'User'
              );
              return (
                <Typography
                  sx={{
                    textAlign: 'center',
                    fontSize: '0.875rem',
                    width: 150,
                    height: 40,
    
                    ...(userLevel?.Level === 'Expert' && {
                      color: 'green',
                      fontWeight: 'bold',
                    }),
                    ...(userLevel?.Level === 'Confirmed' && {
                      color: 'green',
                    }),
                    ...(userLevel?.Level === 'Intermediate' && {
                      color: 'orange',
                    }),
                    ...(userLevel?.Level === 'Beginner' && {
                      color: 'lightsalmon',
                    }),
                    ...(userLevel?.Level === 'Unknow' && { color: 'grey' }),
                  }}
                >
                  {userLevel?.Level}
                </Typography>
              );
            },
          },
              {
                headerName: 'Level by referent',
                headerAlign: 'center',
                align: 'center',
                renderCell: (convertedRows) => {
                  const referentLevel = convertedRows?.row?.Level?.find(
                    (level) => level?.Role === 'Referent'
                  );
                  console.log('2', referentLevel);
    
                  return (
                    <Typography
                      sx={{
                        textAlign: 'center',
                        fontSize: '0.875rem',
                        width: 150,
                        height: 40,
    
                        ...(referentLevel?.Level === 'Expert' && {
                          color: 'green',
                          fontWeight: 'bold',
                        }),
                        ...(referentLevel?.Level === 'Confirmed' && {
                          color: 'green',
                        }),
                        ...(referentLevel?.Level === 'Intermediate' && {
                          color: 'orange',
                        }),
                        ...(referentLevel?.Level === 'Beginner' && {
                          color: 'lightsalmon',
                        }),
                        ...(referentLevel?.Level === 'Unknow' && { color: 'grey' }),
                      }}
                    >
                      {referentLevel?.Level}
                    </Typography>
                  );
                },
              },
            ].concat(
              Object.keys(convertedRows[0])
                .filter(
                  (field) =>
                    field !== 'updated_at' &&
                    field !== 'created_at' &&
                    field !== 'id' &&
                    field !== 'Level'
                )
                .map((field) => {
                  return {
                    field: field,
                    headerName: field,
                    flex: 1,
                  };
                })
            )
          : [];


  return <TableReusable data={convertedRows} columns={columns} bool={false} />;
};

My ‘table reusable’

import React from 'react';
import {
  DataGrid,
  GridToolbar,
  GridToolbarQuickFilter,
} from '@mui/x-data-grid';
import { useDispatch } from 'react-redux';
import { Box, Stack } from '@mui/material';

export const TableReusable = ({ data, columns, bool, setSkillSelected }) => {
  const dispatch = useDispatch();
  const onRowsSelectionHandler = (ids) => {
    const selectedRowsData = ids?.map((id) =>
      data?.find((row) => row?._id === id || row?.id === id)
    );
    if (setSkillSelected) {
      dispatch(setSkillSelected(selectedRowsData));
    }
  };

  function NoRowsOverlay() {
    return (
      <Stack height="100%" alignItems="center" justifyContent="center">
        No skills for the moment
      </Stack>
    );
  }

  function NoResultsOverlay() {
    return (
      <Stack height="100%" alignItems="center" justifyContent="center">
        No results
      </Stack>
    );
  }

  function QuickSearchToolbar() {
    return (
      <Box
        sx={{
          display: 'flex',
          justifyContent: 'space-between',
          p: 0.5,
          pb: 0,
        }}
      >
        <GridToolbar />
        <GridToolbarQuickFilter
          quickFilterParser={(searchInput) =>
            searchInput
              .split(',')
              .map((value) => value.trim())
              .filter((value) => value !== '')
          }
        />
      </Box>
    );
  }

  return (
    <>
      <DataGrid
        density="comfortable"
        sx={{
          height: data?.length > 0 ? '100%' : 250,
          width: '100%',
          background: 'white',
          '.MuiDataGrid-columnHeaderTitle': {
            fontWeight: 'bold !important',
            overflow: 'visible !important',
          },
        }}
        rows={data}
        getRowId={(row) => row?.id || row?._id || row?.CommonId}
        columns={columns}
        initialState={{
          pagination: { paginationModel: { pageSize: 10 } },
          ...data.initialState,
        }}
        onRowSelectionModelChange={(ids) => onRowsSelectionHandler(ids)}
        components={{ NoRowsOverlay, NoResultsOverlay }}
        pageSizeOptions={[5, 10, 15, 20, 50, 100]}
        checkboxSelection={bool}
        slots={{ toolbar: QuickSearchToolbar }}
        componentsProps={{
          pagination: {
            labelRowsPerPage: 'Nb by page',
          },
        }}
      />
    </>
  );
};

What I have already tried:

If I switch the position in columns of ‘level by user’ and ‘level by referent’ then it is now ‘level by user’ which will be displayed twice

I also tried putting ‘level by user’ first and then adding ‘level by referent’ in the concat. But the same problem happens (I get the columns ‘level by referent’ twice)

deferred event in Socket.io event

I am implementing a socket.io chat system and would like to find out a way to address a problem I am facing.

socket.on("private message", message => {
        let nome = $.post("/endpoints/getNomeChat.php", {
            userID: message.from
        }, function(data) {
            const currentUrl = reqPath.split('?');
            if (currentUrl[0] == "chat.php") {
                //if this is true I have to modify some elements of the DOM
                //that have been added to the DOM with ajax
                $('.addedElement').append(data);
                //will not work since `.addedElement` has been added later to the DOM
            }

So the point is that if the if evaluates to true I want to manipulate some elements of the DOM that where not there on page load but have been added later to the page. Normaly I’d use jquery .on to do this but here I have no event to pass to .on and thus I am stucked.

How can I solve this?

Audio tag record 2 sounds and save as file or base64 with js

i’m trying to record output sound as file or wav or base64.

  1. play sound
  2. record audio

I think it’s possible with AudioContext or buffer or canvas but i don’t know how.
My goal is to get the record until i play pause.

<html>
<head>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>

</head>
<body>
<audio id="sound_load_1"  controls autoplay>
    <source src="data:audio/wav;base64,.......">
</audio>
<audio id="sound_load_2"  controls autoplay>
    <source src="data:audio/wav;base64,.......">
</audio>
<div id="output">

</div>
<p>
  <button onclick="playAudio()">Play Audio</button>
  <button onclick="pauseAudio()">Pause Audio</button>
  <button onclick="recordAudio()">Record Audio</button>
</p>

<script>
  function playAudio() {
    var audio1 = document.getElementById("sound_load_1");
    audio1.play();
    audio1.loop = true;
    
    var audio2 = document.getElementById("sound_load_2");
    audio2.play();
    audio2.loop = true;
    
    
    
  }

  function pauseAudio() {
     var audio1 = document.getElementById("sound_load_1");
    audio1.pause();
    
    var audio2 = document.getElementById("sound_load_2");
    audio2.pause();
  }
  
  function recordAudio()
  {
        alert('recordAudio')
 
  } 
  

</script>
</body>
</html>

Here is all the script :
https://codepen.io/lorenzoweb/pen/poYRNbr

because i use base64 content and it was too long to embed here.

What is the syntax for writing a javaScript code? [closed]

  1. How to calculate days and time between two selected dates
    e.g., days = endDate – startDate

  2. javaScript to create a download for a review form after a document has been uploaded from the requester

  3. javaScript to display the current date and time immediately a form is loaded.

I need an assistance to resolve to three question issues.

Error: [Reanimated] Failed to create a worklet

I have this error with the ios and android build of an app. I constantly receive the same error no matter what I try. I tried most of the changes I found over here around this discussion and nothing seems to work.

I am using React native and not expo.

Error: [Reanimated] Failed to create a worklet. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#failed-to-create-a-worklet for more details., js engine: hermes
    at DrawerViewBase (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.safevuenotification:186943:22)
    at RCTView
    at View (http://localhost:8081/index.bundle//&platform=ios&dev=true&lazy=true&minify=false&inlineSourceMap=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.safevuenotification:59687:43)
    at GestureHandlerRootView
    at RCTView ...............

Any suggestions based on the bellow?

"dependencies": {
    "@react-native-async-storage/async-storage": "^1.21.0",
    "@react-native-community/netinfo": "^11.2.1",
    "@react-native-firebase/app": "^18.7.3",
    "@react-native-firebase/messaging": "^18.7.3",
    "@react-native-picker/picker": "^2.6.1",
    "@react-navigation/drawer": "^6.6.6",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/stack": "^6.3.20",
    "axios": "^1.6.2",
    "native-base": "^3.4.28",
    "react": "18.2.0",
    "react-native": "0.73.1",
    "react-native-calendars": "^1.1303.0",
    "react-native-collapsible": "^1.6.1",
    "react-native-element-dropdown": "^2.10.1",
    "react-native-gesture-handler": "^2.14.0",
    "react-native-paper": "^5.11.4",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "^3.6.1",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "^4.8.1",
    "react-native-vector-icons": "^10.0.3"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "^0.73.18",
    "@react-native/eslint-config": "^0.73.1",
    "@react-native/metro-config": "^0.73.2",
    "@react-native/typescript-config": "^0.73.1",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-test-renderer": "18.2.0",
    "typescript": "5.0.4"
  },

Error in example from book – ‘placeholder’ is not implemented as a property of ‘el’ in ‘if ( !el.placeholder )’

This is a Placeholder Polyfill script example from book ‘JavaScript & jQuery – Interactive Front-End’ {see the pic}.
Problem script screenshot

In the highlighted script line numbered as (7) in the pic, condition (!el.placeholder) inside ‘if’ depends on ‘placeholder’ being a implemented as a property of element ‘el’ so that it can have falsy or truthy values. While the basis of this script is to run only when browser does not support ‘placeholder’ property in form elements, it seems to me as an incorrect example.

I am a still a novice self-learner web developer. I just want to make sure if I am correct and this example is wrong according to my understanding. And if I am wrong (book is correct) please kindly explain in detail.

Hey why is my player.currentChoice undefined?

`const player = {
    currentChoice: null //my initial declaration
};



//creating a function to give one of 3 choices to player
const playerChooses = () =>{
    let value; //declaring a new variable
    
    //returning the text of the button using onclick function
    document.getElementById('pick1').onclick = function(e) {
        value = e.target.innerText;
        console.log(value);
        return String(value);

    }
    document.getElementById('pick2').onclick = function(e) {
        value = e.target.innerText;
        console.log(value);
        return String(value);
    }
    document.getElementById('pick3').onclick = function(e) {
        value = e.target.innerText;
        console.log(value);
        return String(value);

    }

}

//invoking the function
player.currentChoice = playerChooses();
console.log(player.currentChoice);`

My player.currentChoice = undefined. I am not sure if my code is wrong. I tried using if statements for each of the clicks. i tried converting to string but still cant seem to get the player.currentChoice to be the value being returned. The values i console logged are equal to what the buttons are. Anyone can help?

what is the deep difference between array.find() and array.forEach()

i know the difference between the find and for each methods
from point that find will return the element that match the condition
but i want to figure out the useful of using any of them if i use array.find()
to applay a specific function not only search for a specific value in an array

find method

type herlet g=[1,2,3,4,5,6,1,2,3,4,5,6]
let counter=0;
let idxArray=[];
g.find((el,ix,g)=>{
    if (el===3){
        counter++;
        idxArray.push(ix);}
})
console.log(idxArray);

for each method

let g=[1,2,3,4,5,6,1,2,3,4,5,6]
let counter=0;
let idxArray=[];
g.find((el,ix,g)=>{
    if (el===3){
        counter++;
        idxArray.push(ix);}
})
console.log(idxArray);

what is best approach for creating public apis for developers. they can easily integrate my apis with any website or app? using node and express

I have created website which is providing Manytypes of services for users. now currently user come to my website and after register they can use my service. but now I am planning to generate public apis for developer to integrate my apis with their website. and use my service apis end-points with his personal access token. and access token will generated after register on my website.
**

so What is best Approach for creating this ? how can i validate access token after user request **

React Routing definition using Hash Router

I am trying to implement hash-based routing in my React App. below is my code setup;

index.js

import('./bootstrap');

bootstrap.jsx

ReactDOM.render(<BootstrapApp />, document.getElementById("root"))

BootstrapApp.js

import { Route, BrowserRouter, Routes } from 'react-router-dom';
import {HashRouter as Router} from 'react-router-dom';
import App from './App';

function BootstrapApp() {
  return (
      <Router>
        <ThemeProvider>
          <App />
        </ThemeProvider>
      </Router>
  );
}

export default BootstrapApp;

App.js

import { Route, Routes } from "react-router-dom";
//import {HashRouter as Router} from 'react-router-dom';
import MyInq from "./my-inq/MyInq";

function App() {
  return (
    <>
      <div>
        {/*
        <Routes>
          <Route path="/my-inq" element={<MyInq />} />
        </Routes>
        */}
        <Routes>
          <Route path="/*" element={<MyInq />} />
          <Route path="/my-inq/*" element={<MyInq />} />
        </Routes>
      </div>
    </>
  );
}

export default App;

In MyInq.js, all I have is a function component that renders “Hello World”

Now, all I want is if I hit the URL http://localhost:3001/#/my-inq
it should render the “Hello World” from MyInq component

With the above setup, while I am able to render that. But if I remove this line from App.js

<Route path="/*" element={<MyInq />} />

then it does not render. Not sure why that is the case.

Also, I wanted to know if there is any difference between these 2 ways of defining the routes;

Syntax 1

<Route exact path="/MyInq">
  <MyInq />
</Route>

Syntax 2

<Routes>
  <Route path="/*" element={<MyInq />} />
  <Route path="/my-inq/*" element={<MyInq />} />
</Routes>

local variables inside of for..of loop & click event are not updating when a new btn is clicked

I’m working on the To-Do List app for The Odin Project.

I’m trying to have btnIndex update whenever a new btn (of detailsBtns) is clicked.

btnIndex does not seem to update after the first click, then as a result the same taskObj is being overwritten instead of each appropriate taskObj in relation to it’s index.

function detailsModal () {
    const detailsModalContainer = document.getElementById('detailsModalContainer');
    const detailsBtns = document.querySelectorAll('.detailsBtn');
    const detailsTitle = document.getElementById('detailsTitle');
    const detailsDetails = document.getElementById('detailsDetails');
    const detailsDate = document.getElementById('detailsDate');

    for (let btn of detailsBtns) {
        btn.addEventListener('click', () => {
            detailsModalContainer.style.display = 'block';

            let folderObj = getSelectedFolder();
            let tasks = folderObj.getTasks();
            let btnsArray = Array.from(detailsBtns);
            let btnIndex = btnsArray.indexOf(btn);
            let taskObj = tasks[btnIndex];

            detailsTitle.value = taskObj.title;
            detailsDetails.value = taskObj.details;
            detailsDate.value = taskObj.date;
            let taskUrgency = taskObj.urgency;

            const urgencyInputs = document.querySelectorAll(`input[name='detailsUrgency']`);
            const urgencyLabelLow = document.querySelector('.detailsUrgencyLow');
            const urgencyLabelMedium = document.querySelector('.detailsUrgencyMedium');
            const urgencyLabelHigh = document.querySelector('.detailsUrgencyHigh');

            setUrgency(urgencyLabelLow, urgencyLabelMedium, urgencyLabelHigh, taskUrgency);

            changeUrgency(urgencyLabelLow, urgencyLabelMedium, urgencyLabelHigh, urgencyInputs);

                //currently submit button is overwriting the same taskObj rather than selecting a new 
                //taskObj when a new btn is clicked

            submitDetailsModal(btnIndex, taskUrgency);
        })

    }

}

function submitDetailsModal (btnIndex, taskUrgency) {
    const submitBtn = document.getElementById('detailsSubmit');

    submitBtn.addEventListener('click', (event) => {
        let title = detailsTitle.value;
        let details = detailsDetails.value;
        let date = detailsDate.value;
        let urgency = '';

        if(document.querySelector('input[name="detailsUrgency"]:checked')){
            urgency = document.querySelector('input[name="detailsUrgency"]:checked').value;
        } else {
            urgency = taskUrgency;
        }

        let folderObj = getSelectedFolder();
        let tasks = folderObj.getTasks();
        let updatedTask = new Task(title, details, date, urgency);

        tasks[`${btnIndex}`] = updatedTask;

        detailsModalContainer.style.display = "none";

        // console.log(event.bubbles);
        console.log(tasks)
        console.log(btnIndex)

        event.stopImmediatePropagation();
        });
}

I’ve tried declaring the local variables outside of the click event with no difference made.

Right now the detailsModal() function is invoked immediately upon page loading, I tried running it each time a btn was clicked with no impact either.

Leaflet or map libre [closed]

I want to use map in react js can you please suggest me which one is perfect Leaflet or map libre

Leaflet or map libre
i want to add filters and want some interactive visual appearance ,also want to add options like google street map actually i want to show crops data on map

CSS/JS: How can i align the rows of a div having contenteditable with the numbers of a vertical column having div and span, using Highlightjs library?

I would like to align the rows of text with the numbers in the yellow vertical bar.

PROBLEM. As you can see from the image, the problem is that the first and second lines are not well aligned with the numbers in the yellow column. The rows in the black panel are created in the yellow empty spaces between the numbers.


enter image description here

HIGHLIGHTJS. I would have liked not to use the Highlightjs library (to select the text color) in the question code, but i noticed that using Highlightjs adds css that creates additional empty space at the top-beginning of the black panel. WITHOUT Highlightjs i have the same problem, but with Highlightjs the empty space is greater, so to find the solution you have to use Highlightjs which already i inserted in html as tag and cdn:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/vs2015.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>

Below you will find the working snippet where everything is included.

DETAILS. In .numbers css, i managed the vertical space between the numbers with the line-height: 1.3 and also their size with font-size: 16px, so i would like the space and size to remain the same. I tried changing some paddings or margins, but doing so breaks the mouse pointer after the last letter of a word or breaks in other ways. I would like to get this or something very similar:

enter image description here

How can i align the lines to the numbers correctly?

IMPORTANT: Attention to the broken mouse pointer on the rows, because the line alignment problem seems solved, but the mouse pointer breaks and does not flash correctly on the rows

In case of help, please please use my code for the solution and not another example code, because as you can see my code is a bit peculiar. Thank you

/// CODE ROWS ///
const textarea = document.querySelector(".hilite-editor");
const numbers = document.querySelector(".numbers");

function updateLineNumbers() {
  const num = textarea.innerHTML.split("n").length;
  numbers.innerHTML = Array(num).fill("<span></span>").join("");
}

// Update line numbers when the page loads
updateLineNumbers();

// Update line numbers when the textarea content changes
textarea.addEventListener("input", updateLineNumbers);

// WHEN I PRESS KEY
textarea.addEventListener("keydown", (event) => {
  if (event.key === "Tab") {
    const start = textarea.selectionStart;
    const end = textarea.selectionEnd;

    textarea.innerHTML =
      textarea.innerHTML.substring(0, start) +
      "t" +
      textarea.innerHTML.substring(end);

    event.preventDefault();
  }
});

/// CODE EDITOR ///

const elHTML = document.querySelector(`[data-lang="html"]`);
const elCSS = document.querySelector(`[data-lang="css"]`);
const elJS = document.querySelector(`[data-lang="js"]`);
const elPreview = document.querySelector("#preview");

const hilite = (el) => {
  const elCode = el.previousElementSibling.querySelector("code");
  elCode.textContent = el.textContent;
  delete elCode.dataset.highlighted;
  hljs.highlightElement(elCode);
};

const preview = () => {  
  const encodedCSS = encodeURIComponent(`<style>${elCSS.textContent}</style>`);
  const encodedHTML = encodeURIComponent(elHTML.textContent);
  const encodedJS = encodeURIComponent(`<scr` + `ipt>${elJS.textContent}</scr` + `ipt>`); 
  const dataURL = `data:text/html;charset=utf-8,${encodedCSS + encodedHTML + encodedJS}`;
  elPreview.src = dataURL;
};

// Initialize!

[elHTML, elCSS, elJS].forEach((el) => {
  el.addEventListener("input", () => {
    hilite(el);
    preview();
  });
  hilite(el);
});

preview();
/******** CODE EDITOR HIGHTLIGHTS.JS **********/  
/* Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0px;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 1rem;
}


.hilite {
position: relative;
background: #1e1e1e;
height: 120px;
overflow: auto;
width: 100%;
height: 100%;
}

.hilite-colors code,
.hilite-editor {
padding: 1rem !important;
top: 0;
left: 0;
right: 0;
bottom: 0;
white-space: pre-wrap;
font: 13px/1.4 monospace;
width: 100%;
background: transparent;
border: 0;
outline: 0;
}

/* THE OVERLAYING CONTENTEDITABLE WITH TRANSPARENT TEXT */
.hilite-editor {
display: inline-block;
position: relative;
color: transparent; /* Make text invisible */
caret-color: hsl( 50, 75%, 70%); /* But keep caret visible */
width: 100%;
}
.hilite-editor:focus {
outline: transparent;
}
.hilite-editor::selection {
background: hsla(0, 100%, 75%, 0.2);
}

/* THE UNDERLAYING DIV WITH HIGHLIGHT COLORS */
.hilite-colors {
position: absolute;
user-select: none;
width: 100%;
}

#preview {
display: block;
background: #fff;
width: 100%;
height: 100%;
border: 0;
}

/* highlight.js customizations: */
.hljs {
background: none;
}


#preview.resizing {
  pointer-events: none;
}

/******** COUNT ROWS **********/  
.numbers {
 text-align: right;
 background: yellow;
 /* padding-right: 20px; */
 width: 35px;
 height: 200px;
 /* margin-right: 71px; */
 line-height: 1.3;
 font-size: 15px;
}

.numbers span {
 counter-increment: linenumber;
}

.numbers span::before {
 content: counter(linenumber);
 display: block;
 color: black;
}

/******** CONTAINERS **********/  
.container {
 /*max-width: 700px; */
 min-height: 16em;
 border-radius: 4px;
 margin: 0;
 padding:0;
}

.container--tabs {
 list-style: none;
 display: flex;
 flex-direction: row;
 justify-content: flex-start;
 align-items: stretch;
 margin: 0;
 padding:0;
 background-color: #282828;

 .tab {
   min-height: 2em;
   padding: 7px;
   box-sizing: border-box;
   width: 127px;
   text-align: center;
   cursor: pointer;
   background-color: #363636;
   color: white;
   transition: background-color 0.25s;
   border-right: 1px solid #5a5a5a;

   &:hover {
     background-color: rgba(0, 0, 0, 0.25);
     transition: background-color 0.25s;
     color: white;
   }
 }

 .tabs--active {
   background-color: #1e1e1e;
   color: white;
   pointer-events: none;
 }
}

.content {
 display: none;
 padding: 0;

}

.content--active {
 display: flex;
 height: 800px;
}

h1 {
 margin-bottom: 0.5em;
 font-weight: 700;
}

p {
 font-weight: 300;
}
<!-- Highlight js -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/vs2015.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>

    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>

<div class="container--content">
  <div class="content content--active">

    <div class="numbers">
      <span></span>
    </div>  

    <div class="hilite">

      <pre class="hilite-colors"><code class="language-html"></code></pre>
      <div
           data-lang="html"
           class="hilite-editor"
           contenteditable="true"
           spellcheck="false"
           autocorrect="off"
           autocapitalize="off"
           >&lt;h1 class="heading" title="test this" data-some='foo bar'>This is a Heading&lt;/h1>   
        &lt;p>This is a paragraph.&lt;/p></div>
    </div>  
  </div>
  
  
</div>
</div>