"use client";
import { cn } from "@/lib/utils";
import { motion } from "motion/react";

type CheckSmallProps = {
  className: string;
  animated?: boolean;
};

const CheckSmall = ({ className, animated = false }: CheckSmallProps) => {
  if (animated)
    return (
      <svg
        className={cn(className)}
        viewBox="0 0 24 24"
        fill="none"
        stroke="currentColor"
        strokeWidth="4"
        strokeLinecap="round"
        strokeLinejoin="round"
      >
        <motion.path
          initial={{ pathLength: 0 }}
          animate={{ pathLength: 1 }}
          exit={{ pathLength: 0 }}
          transition={{ duration: 0.5 }}
          d="M4 12l5 5L20 6"
        />
      </svg>
    );
  return (
    <svg
      className={cn("fill-inherit h-auto transition-colors", className)}
      viewBox="0 0 25 19"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <path
        d="M8.33333 19L0 10.9149L2.91667 8.08511L8.33333 13.3404L22.0833 0L25 2.82979L8.33333 19Z"
        fill="currentColor"
      />
    </svg>
  );
};

export default CheckSmall;
