import { Box, Typography, useTheme, useMediaQuery } from "@mui/material";

type Props = {
  text: string;
  text2: string;
  image: string;
};

export default function CreationFullCard({ text, text2, image }: Props) {
  const theme = useTheme();
  const isSmallMonitor = useMediaQuery(theme.breakpoints.down(1500));

  return (
    <Box
      sx={{
        flexGrow: 1,
        backgroundColor: "white",
        p: "20px",
        marginTop: "50px",
        borderRadius: "12px",
        display: isSmallMonitor ? "block" : "flex",
        flexDirection: isSmallMonitor ? "column" : "row",
        gap: "20px",
        boxShadow: `0px 100px 309px rgba(210, 208, 225, 0.24),
                   0px 41.7776px 129.093px rgba(210, 208, 225, 0.172525), 
                   0px 22.3363px 69.0192px rgba(210, 208, 225, 0.143066), 
                   0px 12.5216px 38.6916px rgba(210, 208, 225, 0.12),
                   0px 6.6501px 20.5488px rgba(210, 208, 225, 0.0969343),
                   0px 2.76726px 8.55082px rgba(210, 208, 225, 0.0674749)`,
      }}
    >
      <Box
        sx={{
          mr: !isSmallMonitor ? "104px" : 0,
          marginBottom: "20px",
          position: "relative",
        }}
      >
        <Typography variant="h5" sx={{ marginBottom: "20px" }}>
          Результаты квиза в зависимости от ответов
        </Typography>
        <Box
          sx={{
            display: "flex",
            flexDirection: "column",
            justifyContent: "space-between",
            height: "100%",
            maxHeight: isSmallMonitor ? "none" : "220px",
            gap: "25px",
          }}
        >
          <Typography sx={{ color: "#4D4D4D", width: "95%" }}>
            {text}
          </Typography>
          <Typography
            sx={{
              color: "#9A9AAF",
              width: "100%",
            }}
          >
            {text2}
          </Typography>
        </Box>
      </Box>
      <img
        src={image}
        alt="quiz creation"
        style={{
          display: "block",
          width: isSmallMonitor ? "100%" : "auto",
          maxHeight: isSmallMonitor ? "none" : "270px",
        }}
      />
    </Box>
  );
}
