import { useSelector } from 'react-redux';
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import React, { useState, useEffect } from 'react';
import classNames from 'classnames';

import {
  faBasketShopping,
  faUser,
  faLocationDot,
  faPhone
} from "@fortawesome/free-solid-svg-icons";


import { Search } from './search';
import { selectCart } from '../../redux/cart/selectors';

export const Header: React.FC = () => {
  //const { items, totalPrice } = useSelector(selectCart);
  const [showBasketCard, setShowBasketCard] = useState(false);
  const isMounted = React.useRef(false);
  const updateDataHeader = () => {
    setShowBasketCard(true);
    console.log('clik');
  }
  //const totalCount = items.reduce((sum: number, item: any) => sum + item.count, 0);

  //React.useEffect(() => {
    if (isMounted.current) {
   //   const json = JSON.stringify(items);
     // localStorage.setItem('cart', json);
    }
    isMounted.current = true;
 // }, [items]);

  return (
    <header>
   
  
 
  
  
    </header>
  );
};
