import styled from "styled-components";
import deleteImg from "../../../../../assets/images/warning.png";
import Button from "../../../../button";
import { CloseIcon } from "../../../../header/assets/svg/close";
import useTranslation from "../../../../../hooks/useTranslation.jsx";
import wordStore from "../../../../../mc/wordStore.json";
const DeleteModal = ({ close, onClick, btnText, btnXl }) => {
  const { findText } = useTranslation(wordStore);
  return (
    <Container>
      <Wrapper>
        <span onClick={close}>
          <CloseIcon />
        </span>
        <Content>
          <img src={deleteImg} alt="" />
          <p className="message">
            {findText("Are you sure you want to delete this comment?")}
          </p>

          <BtnGroup>
            <Button
              onClick={close}
              text={findText("Cancel")}
              type="secondary"
              styles={{
                width: btnXl ? '140px' : 'auto',
              }}
            />
            <Button
              onClick={onClick}
              text={btnText || 'Delete'}
              styles={{
                width: btnXl ? '140px' : 'auto',
              }}
            />
          </BtnGroup>
        </Content>
      </Wrapper>
    </Container>
  );
};
export default DeleteModal;
const Container = styled.div`
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.15);
`;
const Wrapper = styled.div`
  width: 430px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  span {
    display: inline-flex;
    padding: 8px;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    background: #fff;
    svg {
      transform: scale(1.2);
    }
  }
`;
const Content = styled.div`
  border-radius: 30px;
  width: 100%;
  background: #fff;
  padding: 43px 0 33px;
  display: flex;
  flex-direction: column;
  align-items: center;
  img {
    width: 90px;
    object-fit: contain;
    height: 92px;
  }
  text-align: center;
  .message {
    width: 218px;
    color: #313333;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: 0.36px;
    margin-top: 15px;
  }
`;
const BtnGroup = styled.div`
  display: flex;
  align-items: center;
  margin-top: 35px;
  gap: 13px;
  margin-bottom: 5px;

  button {
    box-shadow: '0px 10px 20px 0px rgba(254, 191, 16, 0.25)';
  }
`;
