import { Button } from "@heroui/react";
import { useTranslation } from "react-i18next";

type RoundEvaluationOverridesPaginationProps = {
  page: number;
  lastPage: number;
  onPrev: () => void;
  onNext: () => void;
};

export default function RoundEvaluationOverridesPagination({
  page,
  lastPage,
  onPrev,
  onNext,
}: RoundEvaluationOverridesPaginationProps) {
  const { t } = useTranslation("common");

  return (
    <div className="flex items-center gap-2 text-xs">
      <Button type="button" size="sm" variant="bordered" onPress={onPrev} isDisabled={page <= 1}>
        {t("override_prev_page") ?? "Předchozí"}
      </Button>
      <span>{t("override_page_label", { page, lastPage }) ?? `Strana ${page} / ${lastPage}`}</span>
      <Button
        type="button"
        size="sm"
        variant="bordered"
        onPress={onNext}
        isDisabled={page >= lastPage}
      >
        {t("override_next_page") ?? "Další"}
      </Button>
    </div>
  );
}
