1. Задача: Отрефачить следующий код
import { useEffect, useLayoutEffect, useState } from 'react';
import { createRoot } from 'react-dom/client';
import './style.css';
interface Product {
description: string;
id: string;
info: string;
name: string;
}
type Shop = {
coordinate: number[];
id: string;
name: string;
priceList: Record<string, string>;
};
let counter = 10;
var started = false;
const AppTimer = () => {
let currency = ' $';
const [timer, setTimer] = useState(10);
const onDecrease = () => {
if (counter > 0) {
counter--;
setTimer(counter);
}
};
useLayoutEffect(() => {
if (!started)…