update meta property dynamically from the script tag in html

I am working on one project where i need to use html viewport content property interactive-widget but as that is only available in chrome and Firefox so i need to do something which can append that property only if user agent is not safari so how i can achieve this.

Note:- I am also using webpack.

  plugins: [
        new CleanWebpackPlugin(),
        new HtmlWebpackPlugin({
            template: 'web/index.html',
            filename: 'index.html',
            splashLogo: fs.readFileSync(path.resolve(__dirname, `../../assets/images/new-ify${mapEnvToLogoSuffix(envFile)}.svg`), 'utf-8'),
            usePolyfillIO: platform === 'web',
            isStaging: envFile === '.env.staging',
        }),
 </style>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
    <script>
        if (window.safari === undefined) {
            var viewport = document.querySelector('meta[name="viewport"]');
            viewport.content += ', interactive-widget';
        }
    </script>
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
    <link rel="shortcut icon" id="favicon" href="/favicon.png">
    <% if (htmlWebpackPlugin.options.usePolyfillIO) { %>
        <!-- polyfill.io is only needed on Web to support older browsers. It should not be loaded for desktop -->
        <script src="https://polyfill.io/v3/polyfill.min.js?features=default%2CResizeObserver&flags=gated"></script>
    <% } %>
    <link rel="manifest" href="/manifest.json" />
</head>

in above code i am checking if window. Safari is undefined then contact he content string but that is not working as expected.

Is it possible to suppress hydration warnings for all nested children of a component in NextJS?

Note: I am using NextJS 14 but believe this is also a problem in NextJS 13

I have build a ThemeToggle component that uses next-themes. If I build out my own implementation of next-themes using React Context or any other state management solution I’ll run into this same problem.

Here’s my component:

"use client";

import { useTheme } from "next-themes";
import { FaSun, FaMoon } from "react-icons/fa";

export default function ThemeToggle() {
  const { theme, setTheme } = useTheme();

  return (
    <button onClick={() => setTheme(theme === "dark" ? "light" : "dark")}>
      {theme === "dark" ? <FaSun /> : <FaMoon />}
    </button>
  );
}

This is a client component because the useTheme hook is stateful and the server doesn’t have the context of the theme state until it is rendered on the client.

This component works really well except for this annoying hydration warning that I get:

app-index.js:31 Warning: Prop d did not match. Server: …

This is clearly referring to the d prop of the underlying svg in my react-icons icons FaSun and FaMoon.

It makes sense that there is a mismatch here between client and server and I understand why this is occurring because according to the server, theme is undefined initially until the client renders which then defines what the theme is using localStorage.

I found that the recommended way to avoid this hydration error is to first check if the component is mounted before rendering my FaSun or FaMoon component. I accomplished this by rendering a fallback icon in place like this:

"use client";

import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
import { FaSun, FaMoon } from "react-icons/fa";
import { TbFidgetSpinner } from "react-icons/tb";

export default function ThemeToggle() {
  const { theme, setTheme } = useTheme();
  const [isMounted, setIsMounted] = useState(false);

  useEffect(() => {
    setIsMounted(true);
  }, []);

  return (
    <button onClick={() => setTheme(theme === "dark" ? "light" : "dark")}>
      {!isMounted ? (
        <TbFidgetSpinner className="animate-spin" />
      ) : theme === "dark" ? (
        <FaSun />
      ) : (
        <FaMoon />
      )}
    </button>
  );
}

The Problem with this Approach

While this works and I no longer get the error, my user experience has deteriorated. Now whenever I change pages in my NextJS application is flashes to that fallback component.

The user experience was much better when I just had that server-client hydration mismatch, and the hydration mismatch isn’t really a big deal considering the context is just that the server potentially won’t render an icon correctly.

Is there a way to suppress this hydration warning?

Things I’ve tried

  • Use next/dynamic with the ssr: false flag

I’ve tried using next/dynamic to render my ThemeToggle component on its parent like this:

import dynamic from 'next/dynamic'
const ThemeToggle = dynamic(() => import("./ThemeToggle"), { ssr: false })

This doesn’t solve my UX problem with the loading, it actually makes it worse because that just hides the component on page change. If I use a Suspense in there it works the same as my isMounted implementation which is just as bad if not just a worse developer experience.

  • use the suppressHydrationWarning prop

I tried to use the suppressHydrationWarning prop on the button and also the FaSun and FaMoon components like this:

<button
  onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
  suppressHydrationWarning
>
  {theme === "dark" ?
    <FaSun suppressHydrationWarning /> :
    <FaMoon suppressHydrationWarning />
  }
</button>

Unfortunately the suppressHydrationWarning prop only applies directly the the element we’re suppressing, not the underlying children. And given I can’t update my FaSun and FaMoon components directly – since they come from a 3rd party library – this doesn’t work.

Current Work Around

I haven’t tried this yet, but as of right now I believe the only way for me to get around this is to build my own sun and moon icons and apply the suppressHydrationWarning prop to the underlying affected elements directly. This isn’t ideal but it will get the job done.

Conclusion

Is there something I am missing with the go to solution around these kinds of warnings?

I don’t want to turn of all hydration warnings because they are valuable, but I also don’t want the ones that I expect to be lingering there. I also don’t want to compromise the user experience.

Is there something that might exist like a SuppressHydrationWarningBoundary that will cover all underlying hydration warnings in a component that would work something like this?

<button onClick={() => setTheme(theme === "dark" ? "light" : "dark")}>
  <SuppressHydrationWarningBoundary>
    {theme === "dark" ? <FaSun /> : <FaMoon />}
  </SuppressHydrationWarningBoundary>
</button>

Javascript Regex Extract seat numbers

I am looking for some help in generating list of seat numbers that are selected.

A B C D E F
A1 A2 A3 A4 A5 A6
B7 B8 B9 B10 B11 B12
C13 C14 C15 C16 C17 C18
D19 D20 D21 D22 D23 D24
E25 E26 E27 E28 E29 E30
F31 F32 F33 F34 F35 F36
G37 G38 G39 G40 G41 G42
H43 H44 H45 H46 H47 H48
I49 I50 I51 I52 I53 I54
J55 J56 J57 J58 J59 J60

Above table is a seating chart. To select some seats I have give an input field where User can enter range of seats numbers like A1-B7 or select single seats like F31

Example: A1-B7,H43-H45,F31

Given above input I want extract all the seats and generate a sequential list likey

Output:['A1','A2','A3','A4','A5','A6','B7','F31','H43','H44','H45']

Function works fine on localhost but in production gives a strange error

I have a Vue3 application and it works 100% on localhost but in production there are many problems. The one I am concerned with is the following. It’s a simple Vue function to add degrees to a list and like I said it works fine on localhost.

Here is the function:

function addDegree() {
  var list = document.getElementById("education");
  if (list.selectedIndex === 0) {
    return;
  }
  var degree = list.selectedOptions[0].innerHTML;
  if (!education.value.includes(degree)) {
    education.value.push(degree);
  } else {
    fields.value.degreeerrors.push("Degree added already");
    setTimeout(() => {
      fields.value.degreeerrors = [];
    }, 3000);
  }
  if (education.value.length >= 3) {
    const upgradeURL = "http://localhost:8080/upgrade";
    fields.value.degreeerrors.push(
      `Maximum 3 degrees. <a href="${upgradeURL}">Upgrade</a> to allow more`
    );
    setTimeout(() => {
      fields.value.degreeerrors = [];
    }, 10000);
  }
}

I I try and use the function on the live site I get following error in the console, which just looks completely weird and it makes no sense whatsoever:

TypeError: a.value is null
    Cl http://app.founderslooking.com/js/294.93f6d3fc.js:1
    i http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    s http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    n http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    _ http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    E http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    I http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    N http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    u http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    run http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    update http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    $ http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    D http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    L http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    N http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    u http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    run http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    update http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    $ http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    D http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    L http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    T http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    A http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    u http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    run http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    update http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    $ http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    D http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    L http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    u http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    run http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    update http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    $ http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    D http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    L http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    j http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    N http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    u http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    run http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    update http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    i http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    R http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    promise callback*w http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    _ http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    effect http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    j http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    I http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    Ue http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    set value http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    setup http://app.founderslooking.com/js/app.dcf5c8bb.js:1
    setTimeout handler*2549/setup/< http://app.founderslooking.com/js/app.dcf5c8bb.js:1
    we http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    i http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    s http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    __weh http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    M http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    u http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    run http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    update http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    $ http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    D http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    L http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    v http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    ee http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    mount http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    mount http://app.founderslooking.com/js/chunk-vendors.196cc2a7.js:1
    2549 http://app.founderslooking.com/js/app.dcf5c8bb.js:1
    o http://app.founderslooking.com/js/app.dcf5c8bb.js:1
    a http://app.founderslooking.com/js/app.dcf5c8bb.js:1
    O http://app.founderslooking.com/js/app.dcf5c8bb.js:1
    <anonymous> http://app.founderslooking.com/js/app.dcf5c8bb.js:1
    <anonymous> http://app.founderslooking.com/js/app.dcf5c8bb.js:1
chunk-vendors.196cc2a7.js:1:12410

Display result in opensearch with same city result only

I have list of school in opensearch. Issues currently I am facing If I search for school

Something like that all related to school delhi only not other city name.

“Delhi Public School Delhi”

It give me result for :-

  1. North Delhi Public School, North Delhi
  2. Delhi Public School Bikaner
  3. South Delhi Public School, South Delhi
  4. Delhi Public School, Sirsa
  5. Delhi Public School, Kanpur

But I want if search for “Delhi Public School Delhi” I should only get result for

1)Delhi Public School Delhi
2) South Delhi Public School, South Delhi
3) North Delhi Public School, North Delhi
4) Delhi Public School, East of kailash
list goes on…

working on nodejs, javascript-opensearch client

Why the selected value does not shown in drop down box?

Here is my code.

This is a form for filling in the request object attributes.

Expected Result

Users can select a technician from the drop-down box, and then the selected technician information will be stored in the request object.

The problem

My problem is the selected value does not show in the drop-down box.

What I want

I want the drop-down box component to be self-contained.
So, should I store the selected technician object in the reducer object in Technician.js?

I don’t know why the selected technician object is not updated to the Technician.js.

Would you give me some advice on this issue?

Highchart copy into clipboard

Is there any chance to copy or export chart from highchart into the clipboard. Like click right in the chart then copy and i can paste into the ms. office such a word, powerpoint, and excel. Thank you

Getting Error syntax error at or near “FROM” in RawSQL using Sequlize with PostGresql

am having Error
syntax error at or near "FROM"
am using Sequlize Raw Query

Below is the Query

const sqlQuery = `
SELECT
        DATE("createdAt") AS date,
        TO_CHAR("createdAt", 'HH24'||CHR(58)||'MI'||CHR(58)||'SS') AS time
        ${params.doExport && params.doExport !== "" ? `, ${Object.values(params.exportColumns).join(', ')}` : ''}
    FROM "acq_" WHERE DATE("createdAt") >= :startDate AND DATE("createdAt") <= :endDate
    ${params.msi&& params.msi!== "" ? 'AND "msi" = :msis' : ''}
    ${params.am&& params.am!== "" ? 'AND "am" = :am' : ''}
    ${params.orderNum && params.orderNum !== "" ? 'AND "orderNum" = :orderNum' : ''}
    ORDER BY "${params.sortBy}" ${params.sortType}
    LIMIT :limit OFFSET :offset
`;
const [results, metadata] = await db.sequelize.query(sqlQuery, {
            replacements: {
                msi: params.msi
                ///
            },
            type: sequelize.QueryTypes.SELECT,
        });

am using conditions as some filters are optional

well tried different syntaxes but still error occurs

How to dynamically display mobile-sized video ads instead of desktop-sized video ads when a phone user visits the web page

My website displays some video ads with the following code. Currently, all videos are always 640px wide, but the problem is that these 640px videos do not fit on the mobile phone screen.

The web page becomes scrollable because of the video. How can I force the video size to fit a smaller screen if the URL parameter ‘mobilesize=1’ exists? The current code does not work.

        const adsRequest = new google.ima.AdsRequest();
            
        adsRequest.adTagUrl = 'XX'; 
            
        // Specify the linear and nonlinear slot sizes. This helps the SDK to
        // select the correct creative if multiple are returned.
        adsRequest.linearAdSlotWidth = 640;
        adsRequest.linearAdSlotHeight = 480;

        adsRequest.nonLinearAdSlotWidth = 640;
        adsRequest.nonLinearAdSlotHeight = 240;


        if (getUrlParam("mobilesize")=="1") {
                adsRequest.linearAdSlotWidth = 401;
                adsRequest.nonLinearAdSlotWidth = 401;
        }

Changing MUI Datepicker defaultvalue

I am using @mui/x-date-pickers version ^6.17.0.

This is my date picker

enter image description here

When I click the input field the placeholder changes and value is added. I can not change the input value.

enter image description here

My whole code

import { useRef, useState } from 'react';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
import { Controller } from 'react-hook-form';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
import { az, enUS } from 'date-fns/locale';
import { useTranslation } from 'react-i18next';

const DatePickerMui = ({
  name,
  title,
  value,
  minDate,
  maxDate,
  control,
  myChange,
  isClearable,
  time = false,
  disabled = false,
  defaultValue = null,
  dateFormat = time ? 'dd-MM-yyyy hh:mm' : 'dd-MM-yyyy',
  views = time ? ['year', 'month', 'day', 'hours', 'minutes'] : ['year', 'month', 'day'],
}) => {
  const [open, setOpen] = useState(false);
  const { i18n, t } = useTranslation();

  return (
    <div className="form-group date-component">
      <label style={{ marginBottom: '5px', display: 'block' }}>{title}</label>
      <Controller
        control={control}
        name={name}
        defaultValue={defaultValue}
        render={({ field }) => {
          return (
            <LocalizationProvider
              dateAdapter={AdapterDateFns}
              adapterLocale={i18n.language === 'az' ? az : enUS}
            >
                <DateTimePicker
                  open={open}
                  onOpen={() => setOpen(true)}
                  onClose={() => setOpen(false)}
                  control={control}
                  onChange={newValue => {
                    field.onChange(newValue);
                    if (myChange) {
                      myChange(newValue);
                    }
                  }}
                  format={dateFormat}
                  minDate={minDate}
                  disabled={disabled}
                  maxDate={maxDate}
                  views={views}
                  slotProps={{
                    field: { clearable: disabled ? false : isClearable ? true : false },
                    textField: {
                      placeholder: t('datePlaceholder') // gg-aa-iiii ss:dd,
                      onClick: () => setOpen(true),
                    },
                  }}
                />
            </LocalizationProvider>
          );
        }}
      />
    </div>
  );
};

export default DatePickerMui;

I also tried but it does not work

          slotProps={{
                    field: { clearable: disabled ? false : isClearable ? true : false },
                    textField: {
                      onClick: () => setOpen(true),
                      placeholder: t('datePlaceholder'),
                      value: t('datePlaceholder'),
                      defaultValue: t('datePlaceholder'),
                    },
                  }}

Polar Area chart JS

I have a polarArea chart on my dashboard. I want to add an animation to it. Could you please let me know how to do it? If you provide me with one, I would be really happy.

// three provinces chart
let threeProvinces = ['Kabul', 'Herat', 'Mazar'];
let provincesCrimes = [131, 95, 50];
const crimeChartThreeProvinces = document.getElementById('crimeChartThreeProvinces');

new Chart(crimeChartThreeProvinces, {
  type: 'polarArea',
  data: {
    labels: threeProvinces,
    datasets: [{
      label: 'Traffic Crimes',
      data: provincesCrimes,
      backgroundColor: [
        'rgba(255,99,132,0.9)',
        'rgba(54,162,235,0.9)',
        'rgba(255,206,86,0.9)',
      ],
      borderWidth: 1
    }]
  },
  options: {
    responsive: true,
    // new 

    // end new 
  }
});

How to make Column names bold in XLSX?

I am using the XLSX library in Angular with TypeScript for creating spreadsheet reports. I want to make the column names bold. How can I achieve that?

export_to_excel() {
  this.downloadSpinner = true;
  this.reportService.getBCPayoutReportData()
    .subscribe({
      next: data => {
        if (data.length != 0) {
          let XlsMasterData = data
          const workSheet = XLSX.utils.json_to_sheet(XlsMasterData);
          this.fixWidth(workSheet);
          const workBook: XLSX.WorkBook = XLSX.utils.book_new();
          XLSX.utils.book_append_sheet(workBook, workSheet, 'SheetName');
          XLSX.writeFile(workBook, 'report.xlsx');
        } else {
          this.showSwalmessage("No record Found!", "", "warning", true);
        }
      },
      error: (error: any) => {
        this.showSwalmessage("Something Went wrong", error, "warning", true);
      },
      complete: () => {
        this.downloadSpinner = false;
      }
    });
}


How can I change a table into an endless scrolling format?

I’m a beginner in front-end development, and I’m currently working on a website for a team project. Initially, I designed a simple table to display user names, view counts, and like counts. However, I’ve since changed my plan. I now want to implement endless scrolling for my project. Could you please teach me how to do that?

Here is my first design and code.enter image description here

apologize for not providing any information in my initial question.
I will ensure to include more information in my future queries.