import { useNavigate } from "react-router";

interface LogoProps {
  children?: JSX.Element;
  /**
   * 是否可以点击
   */
  isClicked?: boolean;
}

export const Logo = (props: LogoProps) => {
  const { isClicked = true } = props;
  const navigate = useNavigate();
  return (
    <div
      style={{
        display: "flex",
        alignItems: "center",
        cursor: isClicked ? "pointer" : "default",
      }}
      onClick={() => isClicked && navigate("/list")}
    >
      <svg
        xmlns="http://www.w3.org/2000/svg"
        width="45"
        height="47"
        viewBox="0 0 45 47"
        fill="none"
      >
        <path
          d="M24.273 7.7653L19.6087 11.3716L15.3793 5.98863L11 7L30 35.5L34.1633 30.0428L32.7808 28.1213C32.1142 27.1213 31.6711 25.3464 33.2711 24.1464C34.8711 22.9464 36.6061 23.6397 37.4394 24.473L40.7354 28.7305L30 47L0 0H18.0882L24.273 7.7653Z"
          fill="#2E97D1"
        />
        <path
          d="M43.645 9.14625C42.6195 7.84489 40.7332 7.62124 39.4319 8.64673L30.4992 15.6858L28.646 13.3226C27.6235 12.0188 25.7378 11.7907 24.434 12.8132C23.1302 13.8356 22.9022 15.7213 23.9246 17.0251L29.4784 24.1071L29.4954 24.0939L29.506 24.1074L43.1455 13.3594C44.4468 12.3339 44.6705 10.4476 43.645 9.14625Z"
          fill="#2E97D1"
        />
      </svg>
      <svg
        style={{ paddingLeft: 12 }}
        xmlns="http://www.w3.org/2000/svg"
        width="95"
        height="26"
        viewBox="0 0 95 26"
        fill="none"
      >
        <path
          d="M2.08 18.8C1.89333 18.8 1.72 18.7667 1.56 18.7C1.4 18.6333 1.26 18.54 1.14 18.42C1.03333 18.3 0.96 18.16 0.92 18C0.88 17.8267 0.886667 17.6467 0.94 17.46L2.28 7.48H14.38L14.18 9.4H5.74L4.78 16.88H12.26L13.22 16.12L12.84 18.8H2.08ZM18.4758 18.8L16.3558 8.04L15.9758 7.48H20.0158L21.5358 15.34L25.3758 7.48H29.2158L23.8558 18.8H18.4758ZM44.1595 7.48L43.3995 13.62C43.2929 14.0067 43.0795 14.3267 42.7595 14.58C42.4529 14.8333 42.1529 14.96 41.8595 14.96H35.1395L34.5595 18.8H30.9195L32.2595 8.04L31.6795 7.48H44.1595ZM35.9195 9.4L35.5195 13.04H39.5595L40.1395 9.4H35.9195ZM51.3409 7.48L49.6009 18.8H45.9609L47.3009 8.24L46.7209 7.48H51.3409ZM58.4238 7.48L57.0838 16.88H64.5638L64.3838 18.8H54.4038C54.0171 18.8 53.7238 18.6733 53.5238 18.42C53.3371 18.1667 53.2438 17.8467 53.2438 17.46L54.4038 8.24L53.8238 7.48H58.4238ZM78.1963 7.48C78.3829 7.48 78.5563 7.51333 78.7163 7.58C78.8763 7.64667 79.0096 7.74 79.1163 7.86C79.2363 7.98 79.3163 8.12 79.3563 8.28C79.3963 8.44 79.3896 8.62 79.3363 8.82L77.9963 18.8H67.2363C67.0496 18.8 66.8763 18.7667 66.7163 18.7C66.5563 18.6333 66.4163 18.54 66.2963 18.42C66.1896 18.3 66.1163 18.16 66.0763 18C66.0363 17.8267 66.0429 17.6467 66.0963 17.46L67.4363 7.48H78.1963ZM70.8963 9.4L69.9363 16.88H74.3563L75.4963 9.4H70.8963ZM84.0534 18.8L85.3934 9.4H81.1734L81.3734 7.48H93.6534L93.2734 9.4H89.2334L87.8934 18.8H84.0534Z"
          fill="#F5F5F5"
        />
      </svg>
    </div>
  );
};
