import { Button } from "@repo/shadcn-ui/components";
import { ChevronLeftIcon } from "lucide-react";
import { useNavigate } from "react-router-dom";

import { useTranslation } from "../../locales/i18n.ts";

export const BackHistoryButton = () => {
  const { t } = useTranslation();
  const navigate = useNavigate();

  return (
    <Button className="h-7 w-7" onClick={() => navigate(-1)} size="icon" variant="outline">
      <ChevronLeftIcon className="w-4 h-4" />
      <span className="sr-only">{t("common.back")}</span>
    </Button>
  );
};
