import React from 'react';
import { useAppSelector } from '../redux/hooks';
import { useWindowSize } from '../redux/hooks/useWindowSize';

const WindowSize: React.FC = () => {
  // Use the custom hook to handle resize events
  useWindowSize();

  // Select window size from Redux store
  const { width, height } = useAppSelector((state) => state.windowSize);

  return (
    <>
      <p>
      [Window Resolution;  
      Width: {width}px Height: {height}px]
      </p>
    </>
  );
};

export default WindowSize;
