"use client";

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

/** A field group lifted out of the form of the same family. */
export default function RegisterVolunteerActions({
  isBusy,
  onClose,
  registerMutation,
}: {
  isBusy: boolean;
  onClose: (() => void) | undefined;
  registerMutation: { isPending: boolean };
}) {
  const { t } = useTranslation();

  return (
  <div className="flex xss:flex-col-reverse justify-center gap-5 pt-10">
    <Button
      className="xss:!w-full"
      variant="primary"
      size="medium"
      type="submit"
      disabled={isBusy}
      loading={registerMutation.isPending}
    >
      {t("COMMON.REGISTER")}
    </Button>
    <Button
      className="xss:!w-full"
      variant="secondary"
      size="medium"
      type="button"
      onClick={onClose}
      disabled={isBusy}
    >
      {t("COMMON.CANCEL")}
    </Button>
  </div>
  );
}
