import React, { useCallback, useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { Messages } from '../../Components/Notifications/Messages';

export const WithoutSalesSetup = () => {
  const subDirectory = import.meta.env.BASE_URL;
  const navigate = useNavigate();
  const [messageType, setMessageType] = useState('warning');
  const [messageData, setMessageData] = useState('need to setup sales setup');
  useEffect(() => {
    setTimeout(() => {
      navigate(`${subDirectory}saleslayouts/sales-selection`);
    }, 1000);
  }, []);

  const onComplete = useCallback(() => {
    setMessageData(null);
    setMessageType(null);
  }, []);
  return (
    <div
      style={{
        display: 'flex',
        justifyContent: 'center',
        alignContent: 'center',
        padding: '100px 0px',
        fontSize: '55px',
        fontWeight: '500',
        color: 'red',
        fontFamily: 'Gilroy',
      }}
    >
      <Messages
        messageType={messageType}
        messageData={messageData}
        onComplete={onComplete}
      />
      Need To Configure Sales Setup
    </div>
  );
};
