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

type props = {
  icon?: any;
  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>
  );
}
