"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 DataCache({
  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="M3 1C1.61929 1 0.5 2.11929 0.5 3.5V5C0.5 6.38071 1.61929 7.5 3 7.5H6.49635C6.69847 7.12614 6.95418 6.82913 7.18722 6.61199C7.45631 6.36128 7.74998 6.16091 8.04058 6H3C2.44772 6 2 5.55229 2 5V3.5C2 2.94772 2.44772 2.5 3 2.5H13C13.5523 2.5 14 2.94772 14 3.5V5C14 5.10489 13.9838 5.20601 13.9539 5.30101C14.4395 5.39332 14.9039 5.52262 15.3298 5.69046C15.3516 5.69906 15.3736 5.70787 15.3957 5.71688C15.4636 5.48979 15.5 5.24915 15.5 5V3.5C15.5 2.11929 14.3807 1 13 1H3ZM3 8.5H6.15941C6.13715 8.64706 6.125 8.80083 6.125 8.96121V10H3C2.44772 10 2 10.4477 2 11V12.5C2 13.0523 2.44772 13.5 3 13.5H6.125V14.0388C6.125 14.3915 6.18378 14.7122 6.27948 15H3C1.61929 15 0.5 13.8807 0.5 12.5V11C0.5 9.61929 1.61929 8.5 3 8.5ZM5 4.25C5 4.66421 4.66421 5 4.25 5C3.83579 5 3.5 4.66421 3.5 4.25C3.5 3.83579 3.83579 3.5 4.25 3.5C4.66421 3.5 5 3.83579 5 4.25ZM6.75 5C7.16421 5 7.5 4.66421 7.5 4.25C7.5 3.83579 7.16421 3.5 6.75 3.5C6.33579 3.5 6 3.83579 6 4.25C6 4.66421 6.33579 5 6.75 5ZM12.0156 7C11.0211 7 10.0922 7.15773 9.38894 7.43489C9.03916 7.57273 8.71379 7.75239 8.46539 7.98382C8.21608 8.21611 8 8.54594 8 8.96121V11.5V14.0388C8 14.4541 8.21608 14.7839 8.46539 15.0162C8.71379 15.2476 9.03916 15.4273 9.38894 15.5651C10.0922 15.8423 11.0211 16 12.0156 16C13.0101 16 13.939 15.8423 14.6423 15.5651C14.9921 15.4273 15.3175 15.2476 15.5659 15.0162C15.8152 14.7839 16.0312 14.4541 16.0312 14.0388V11.5V8.96121C16.0312 8.54594 15.8152 8.21611 15.5659 7.98382C15.3175 7.75239 14.9921 7.57273 14.6423 7.43489C13.939 7.15773 13.0101 7 12.0156 7ZM9.31751 8.89837C9.28805 8.92582 9.27043 8.94679 9.26013 8.96121C9.27043 8.97563 9.28805 8.9966 9.31751 9.02404C9.41227 9.11233 9.58344 9.22061 9.84724 9.32457C10.3711 9.53103 11.1375 9.67241 12.0156 9.67241C12.8937 9.67241 13.6601 9.53103 14.184 9.32457C14.4478 9.22061 14.619 9.11233 14.7137 9.02404C14.7432 8.9966 14.7608 8.97563 14.7711 8.96121C14.7608 8.94679 14.7432 8.92582 14.7137 8.89837C14.619 8.81008 14.4478 8.70181 14.184 8.59784C13.6601 8.39139 12.8937 8.25 12.0156 8.25C11.1375 8.25 10.3711 8.39139 9.84724 8.59784C9.58344 8.70181 9.41227 8.81008 9.31751 8.89837ZM14.6423 10.4875C14.6891 10.4691 14.7355 10.4499 14.7812 10.4299V11.4841C14.7747 11.4962 14.757 11.5225 14.7137 11.5628C14.619 11.6511 14.4478 11.7594 14.184 11.8634C13.6601 12.0698 12.8937 12.2112 12.0156 12.2112C11.1375 12.2112 10.3711 12.0698 9.84724 11.8634C9.58344 11.7594 9.41227 11.6511 9.31751 11.5628C9.27426 11.5225 9.25654 11.4962 9.25 11.4841V10.4299C9.29579 10.4499 9.34215 10.4691 9.38894 10.4875C10.0922 10.7647 11.0211 10.9224 12.0156 10.9224C13.0101 10.9224 13.939 10.7647 14.6423 10.4875ZM14.6423 13.0263C14.6891 13.0079 14.7355 12.9887 14.7812 12.9687V14.0229C14.7747 14.035 14.757 14.0613 14.7137 14.1016C14.619 14.1899 14.4478 14.2982 14.184 14.4022C13.6601 14.6086 12.8937 14.75 12.0156 14.75C11.1375 14.75 10.3711 14.6086 9.84724 14.4022C9.58344 14.2982 9.41227 14.1899 9.31751 14.1016C9.27426 14.0613 9.25654 14.035 9.25 14.0229V12.9687C9.29579 12.9887 9.34215 13.0079 9.38894 13.0263C10.0922 13.3035 11.0211 13.4612 12.0156 13.4612C13.0101 13.4612 13.939 13.3035 14.6423 13.0263ZM14.7846 14.0151C14.7847 14.0151 14.7844 14.0162 14.7834 14.0186C14.784 14.0162 14.7845 14.0151 14.7846 14.0151ZM9.24787 14.0186C9.24726 14.0162 9.24673 14.0151 9.24662 14.0151C9.24655 14.0151 9.24664 14.0155 9.24696 14.0164C9.24716 14.0169 9.24746 14.0177 9.24787 14.0186ZM14.7834 11.4798C14.784 11.4774 14.7845 11.4763 14.7846 11.4763C14.7847 11.4763 14.7844 11.4774 14.7834 11.4798ZM9.24702 11.4771C9.24682 11.4765 9.24667 11.4763 9.24662 11.4763C9.24651 11.4763 9.24681 11.4774 9.24787 11.4798C9.24755 11.4785 9.24725 11.4776 9.24702 11.4771ZM14.784 8.93882C14.7838 8.93937 14.7836 8.9401 14.7834 8.941C14.7844 8.93866 14.7847 8.93748 14.7846 8.93748C14.7846 8.93748 14.7843 8.93793 14.784 8.93882ZM9.24787 8.94099C9.24681 8.93866 9.24651 8.93748 9.24662 8.93748C9.24673 8.93748 9.24726 8.93865 9.24787 8.94099Z"
        fill="currentColor"
      />
    </svg>
  );
}
