File size: 1,107 Bytes
a72140d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"use client";

import React from "react";
import { cn } from "@/utils/cn";

type Direction = "left" | "right";

interface ChevronSlideProps extends React.SVGAttributes<SVGElement> {
  direction?: Direction;
  size?: number; // pixel size for width/height
}

export function ChevronSlide({
  direction = "right",
  size = 16,
  className,
  ...props
}: ChevronSlideProps) {
  const translateClass =
    direction === "right"
      ? "group-hover:translate-x-8"
      : "group-hover:-translate-x-8";
  const orientationClass = direction === "right" ? "" : "rotate-180";

  return (
    <svg
      className={cn(
        "transition-all",
        translateClass,
        orientationClass,
        className,
      )}
      fill="none"
      height={size}
      width={size}
      viewBox="0 0 20 20"
      xmlns="http://www.w3.org/2000/svg"
      aria-hidden="true"
      {...props}
    >
      <path
        d="M8.5 13L11.5 10L8.5 7"
        stroke="currentColor"
        strokeLinecap="round"
        strokeLinejoin="round"
        strokeWidth="1.25"
      />
    </svg>
  );
}

export default ChevronSlide;