import type { NextPage } from 'next';
import React, { useState } from 'react';
import { useSelector } from 'react-redux';
import { MainLayout } from '../layouts/Customer';
import { Login } from '../components/admin/pages/login/Login';
import { CardStock, SkeletonStock, BoxScroll } from '../components';
import { useAppDispatch } from '../redux/store';
import { selectTokenData } from '../redux/login/selectors';

const Admin: NextPage = () => {
  const dispatch = useAppDispatch();
  const [login, setLogin] = useState<boolean>();
  const { token, status_token } = useSelector(selectTokenData);
  function replacer(key:string, value:string) {
    console.log(typeof value);
    if (key === 'token') {
      setLogin(true);
      console.log(value)
    }
  }

  JSON.stringify(token, replacer);

  console.log(login, 'admin');
  return (
        <Login/>
  )
}

export default Admin;
