import { Link, Typography, useTheme } from "@mui/material";
import FlexBetween from "@/components/FlexBetween";
import WidgetWrapper from "@/components/WidgetWrapper";

const AdvertWidget = () => {
  const { palette } = useTheme();
  const dark = palette.neutral.dark;
  const main = palette.neutral.main;
  const medium = palette.neutral.medium;

  const randomAd = Math.floor(Math.random() * 2);
  // console.log(randomAd);

  return (
    <WidgetWrapper>
      <FlexBetween>
        <Typography color={dark} variant="h5" fontWeight="500">
          Sponsored
        </Typography>
        {/* <Typography color={medium}>Werbung machen</Typography> */}
      </FlexBetween>

      {randomAd % 2 === 0 ? (
        <>
          <FlexBetween>
            <Typography color={main}>Studentenportal</Typography>
            <Typography color={medium}>studentenportal.ch</Typography>
          </FlexBetween>
          <Typography color={medium} m="0.5rem 0">
            Lustige Zitate von Dozenten immer aktuell! Zusammenfassungen und alte Prüfungen von Stundenten sind auf dem{" "}
            <Link href="https://studentenportal.ch/" target="_blank" rel="noreferrer noopener">
              Legendären Studentenportal
            </Link>{" "}
            zu finden.
          </Typography>
        </>
      ) : (
        <>
          <FlexBetween>
            <Typography color={main}>Distributed Systems</Typography>
            <Typography color={medium}>dsl.i.ost.ch</Typography>
          </FlexBetween>
          <Typography color={medium} m="0.5rem 0">
            Vorlesungen und Informationen zum{" "}
            <Link
              href="https://dsl.i.ost.ch/lect/fs26/
            "
              target="_blank"
              rel="noreferrer noopener"
            >
              Distributed Systems
            </Link>{" "}
            Modul.
          </Typography>
        </>
      )}
    </WidgetWrapper>
  );
};

export default AdvertWidget;
