/* eslint-disable @cspell/spellchecker */
import { ToastContainer } from 'react-toastify';
import styled from 'styled-components';

const StyledNotiBar = styled(ToastContainer)`
  // https://styled-components.com/docs/faqs#how-can-i-override-styles-with-higher-specificity
  &&&.Toastify__toast-container {
    
  }
  .Toastify__toast {
    min-height: auto;
    width: calc(100% - 32px);
    height: auto;
    margin-top: 20px;
    background-color: rgba(45, 52, 54, 0.8);
    box-sizing: border-box;
    color: #ffffff;

    border-radius: 20px 20px 20px 20px;
    text-align: center;
    -webkit-box-shadow: 1px 1px 10px 0px rgba(43, 38, 38, 0.5);
    -moz-box-shadow: 1px 1px 10px 0px rgba(43, 38, 38, 0.5);
    box-shadow: 1px 1px 10px 0px rgba(43, 38, 38, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 9px 0;
  }
  .Toastify__toast-body {
    padding: 0;
    margin: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .Toastify__toast-body > div:last-child {
    color: #fff;
    font-weight: 600;
    line-height: 16px;
    height: 16px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  @supports (-webkit-touch-callout: none) {
    &&&.Toastify__toast-container {
      top: 0;
    }
    .Toastify__toast-body > div:last-child {
      margin-top: calc(env(safe-area-inset-top) - 5px);
    }
  }
`;

export const NotiBar = () => {
  return (
    <StyledNotiBar
      position="top-center"
      autoClose={3000}
      limit={1}
      hideProgressBar
      newestOnTop={false}
      closeOnClick={false}
      rtl={false}
      pauseOnFocusLoss={false}
      draggable
      pauseOnHover={false}
      containerId={'notibar'}
      draggableDirection="y"
      draggablePercent={30}
      closeButton={false}
    />
  );
};
