import { cn } from "@/lib/utils";
import { ChevronLeft, ChevronRight } from "lucide-react";

type Direction = "rtl" | "ltr";
type Orientation = "forward" | "backward";

type DirectionalChevronProps = {
  direction: Direction;
  orientation?: Orientation;
  className?: string;
};

export function DirectionalChevron({
  direction,
  orientation = "forward",
  className,
}: DirectionalChevronProps) {
  const pointsRight =
    (direction === "ltr" && orientation === "forward") ||
    (direction === "rtl" && orientation === "backward");

  const Icon = pointsRight ? ChevronRight : ChevronLeft;

  return <Icon className={cn("shrink-0", className)} />;
}
