"use client";

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

interface VolunteerHoursFieldsProps {
  /** The accessibility / urgency tick-boxes. */
  selectedCheckBoxes: string[];
  handleCheckboxChange: (key: string, checked: boolean) => void;
}

/** The row of flags that describe the opportunity's nature. */
export default function VolunteerHoursFields({
  selectedCheckBoxes,
  handleCheckboxChange,
}: VolunteerHoursFieldsProps) {
  const { t } = useTranslation();

  return (
    <div className="flex 2xl:gap-[143px] laptopitm:gap-[100px] lg:gap-[100px] miniscreen:gap-[85px] miniscreen7:gap-[95px] miniscreen6:gap-[120px] msscreen1:gap-[140px] justify-center mobilescreen:gap-1 mobilescreen:flex-col mb-4 mobilescreen:mb-4 checkbox-container">
      <CheckBox
        id="disabled"
        label={t("COMMON.SUPPORTS_DISABLED")}
        checked={selectedCheckBoxes.includes("disabled")}
        onChange={(checked) =>
          handleCheckboxChange("disabled", checked)
        }
      />
      <CheckBox
        id="relief"
        label={t("COMMON.RELIEF")}
        checked={selectedCheckBoxes.includes("relief")}
        onChange={(checked) =>
          handleCheckboxChange("relief", checked)
        }
      />
      <CheckBox
        id="emergency"
        label={t("COMMON.EMERGENCY_PRIORITY")}
        checked={selectedCheckBoxes.includes("emergency")}
        onChange={(checked) =>
          handleCheckboxChange("emergency", checked)
        }
      />
    </div>
  );
}
