import styled from "styled-components";
import shield from "../../../../assets/images/warning-shield.png";
import ButtonComponent from "./../../../button";
import CloseIcon from "../../../../assets/svg/closeIcon";
import InstructorIcon from "../../../../assets/svg/intructorIcon";
import useTranslation from "../../../../hooks/useTranslation.jsx";
import wordStore from "../../../../mc/wordStore.json";
const ExpiryModal = ({ close, btnText, children, onClick }) => {
  const { findText } = useTranslation(wordStore);
  return (
    <Container>
      <Wrapper>
        <span onClick={close}>
          <CloseIcon />
        </span>
        <Content>
          <SideHero>
            <img src={shield} alt="" />
          </SideHero>
          <Details>
            <Box>
              <InstructorIcon />
              <p>{findText("Instructor")}</p>
            </Box>
            <Children>{children}</Children>
            <ButtonComponent text={btnText} onClick={onClick} />
          </Details>
        </Content>
      </Wrapper>
    </Container>
  );
};
export default ExpiryModal;
const Container = styled.div`
  display: grid;
  place-items: center;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.15);
`;
const Wrapper = styled.div`
  width: 748px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  span {
    display: inline-flex;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    background: #fff;
  }
`;
const Content = styled.div`
  width: 100%;
  height: 438px;
  background-color: #fff;
  border-radius: 30px;
  display: flex;
`;
const SideHero = styled.div`
  flex: 1;
  max-width: 305px;
  display: grid;
  place-items: center;
  background: rgba(249, 84, 84, 0.1);
`;
const Details = styled.div`
  padding: 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  button {
    width: 100%;
    font-size: 14px;
    height: 52px;
    box-shadow: 0px 10px 20px 0px rgba(254, 191, 16, 0.25);
  }
`;
const Box = styled.div`
  border-radius: 15px;
  background: #f5f7f7;
  width: 81px;
  height: 81px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  svg {
    display: inline-block;
    margin-right: 10px;
  }
  p {
    color: #f95454;
    font-size: 12px;
    font-weight: 600;
  }
`;
const Children = styled.div`
  width: 100%;
  .title {
    font-size: 22px;
    font-weight: 700;
  }
  .danger {
    color: #f95454;
  }
  .desc,
  .sub_title {
    font-size: 16px;

    line-height: 20px;
  }
  .desc {
    font-weight: 600;
  }
  .sub_title {
    font-weight: 700;
  }
`;
