import { AntDesign } from "@expo/vector-icons";
import { Button, ButtonActions } from "./ui/button";
import { AntDesignIconNames } from "@expo/vector-icons/build/AntDesign";
import { Href, Link } from "expo-router";

type props = {
  icon?: AntDesignIconNames;
  link: Href;
  action?: ButtonActions;
};

export default function BackButton({ icon, link, action }: props) {
  return (
    <Button className="h-16 w-16 mb-4" action={action ?? "secondary"}>
      <Link href={link}>
        <AntDesign
          name={icon ?? "arrowleft"}
          size={30}
          color={action == "primary" ? "white" : "black"}
        />
      </Link>
    </Button>
  );
}
