"use client";
import { Button } from "@/components/ui/button";
import { LiaCheckSquareSolid } from "react-icons/lia";
import { useTranslations } from "next-intl";

interface TermsAndConditionsActionsProps {
  onToggle: (agreed?: boolean) => void;
}

export default function TermsAndConditionsActions({
  onToggle,
}: TermsAndConditionsActionsProps) {
  const t = useTranslations("TermsAndConditionsPage");

  const handleClose = () => {
    onToggle();
  };

  const handleAgree = () => {
    onToggle(true);
  };

  return (
    <div className="flex justify-end gap-6 mt-10">
      <Button
        type="button"
        variant="outline"
        size="icon"
        className="border-secondary-dark text-secondary-dark hover:bg-secondary-dark hover:text-primary-main"
        onClick={handleClose}
      >
        <span>{t("close")}</span>
      </Button>
      <Button
        type="button"
        className="bg-secondary-dark text-white hover:bg-secondary-main"
        onClick={handleAgree}
      >
        <span>{t("agree")}</span>
        <LiaCheckSquareSolid className="size-6 font-bold" />
      </Button>
    </div>
  );
}
