"use client";

import React from "react";
import type { CSSProperties } from "react";

import { useIconSize } from "../contexts/IconSizeContext";

type Props = {
  size?: number;
  color?: string;
  style?: CSSProperties;
};

export default function EdgeCache({
  color = "currentcolor",
  size,
  ...props
}: Props) {
  const iconSize = useIconSize();
  const height = size || iconSize.size;
  const width = size || iconSize.size;
  const style = { color, ...props.style };
  return (
    <svg
      {...props}
      data-testid="geist-icon"
      height={height}
      strokeLinejoin="round"
      style={style}
      viewBox="0 0 16 16"
      width={width}
    >
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M0.5 3.5C0.5 2.11929 1.61929 1 3 1H13C14.3807 1 15.5 2.11929 15.5 3.5V5C15.5 5.42035 15.3963 5.81647 15.213 6.16416C14.8042 5.87918 14.3612 5.63998 13.8913 5.45397C13.9608 5.31774 14 5.16345 14 5V3.5C14 2.94772 13.5523 2.5 13 2.5H3C2.44772 2.5 2 2.94772 2 3.5V5C2 5.55229 2.44772 6 3 6H8.03431C7.39874 6.40133 6.83757 6.90978 6.37616 7.5H3C1.61929 7.5 0.5 6.38071 0.5 5V3.5ZM5.73221 8.5H3C1.61929 8.5 0.5 9.61929 0.5 11V12.5C0.5 13.8807 1.61929 15 3 15H6.02182C5.72526 14.5368 5.48583 14.0335 5.3135 13.5H3C2.44772 13.5 2 13.0523 2 12.5V11C2 10.4477 2.44772 10 3 10H5.17393C5.2986 9.47223 5.48761 8.96932 5.73221 8.5ZM4.25 5C4.66421 5 5 4.66421 5 4.25C5 3.83579 4.66421 3.5 4.25 3.5C3.83579 3.5 3.5 3.83579 3.5 4.25C3.5 4.66421 3.83579 5 4.25 5ZM7.5 4.25C7.5 4.66421 7.16421 5 6.75 5C6.33579 5 6 4.66421 6 4.25C6 3.83579 6.33579 3.5 6.75 3.5C7.16421 3.5 7.5 3.83579 7.5 4.25ZM13.2307 12C13.2 12.815 13.0938 13.6278 12.9124 14.4279C13.8564 13.9717 14.5462 13.0724 14.7118 12H13.2307ZM11.8047 14.7359C11.7044 14.7452 11.6028 14.75 11.5 14.75C11.3972 14.75 11.2956 14.7452 11.1953 14.7359C10.9494 13.839 10.8077 12.9211 10.77 12H12.23C12.1923 12.9211 12.0506 13.839 11.8047 14.7359ZM13.2307 11C13.2 10.185 13.0938 9.37224 12.9124 8.57213C13.8564 9.02834 14.5462 9.92764 14.7118 11H13.2307ZM12.23 11C12.1923 10.0789 12.0506 9.16097 11.8047 8.2641C11.7044 8.25477 11.6028 8.25 11.5 8.25C11.3972 8.25 11.2956 8.25477 11.1953 8.2641C10.9494 9.16097 10.8077 10.0789 10.77 11H12.23ZM9.76925 11C9.80005 10.185 9.90616 9.37224 10.0876 8.57213C9.1436 9.02834 8.45381 9.92764 8.28822 11H9.76925ZM10.0876 14.4279C9.90616 13.6278 9.80005 12.815 9.76925 12H8.28822C8.45381 13.0724 9.1436 13.9717 10.0876 14.4279ZM11.5 16C13.9853 16 16 13.9853 16 11.5C16 9.01472 13.9853 7 11.5 7C9.01472 7 7 9.01472 7 11.5C7 13.9853 9.01472 16 11.5 16Z"
        fill="currentColor"
      />
    </svg>
  );
}
