import ArrowLeftPA from "@/components/icons/ArrowLeftPA";
import { Button } from "@mui/material";
import Form from "./Form";
import { checkAllValues } from "@/helper";
import ScrollToTop from "@/app/component/ScrollToTop";

function OfficeInformation({ setValue, parent, data, setData }) {
  return (
    <div className="opacity-page pb-[24px] px-0 md:px-[24px] lg:px-[56px]">
      <ScrollToTop />
      <Form parent={parent} setData={setData} data={data.office} />
      <div className="mt-[40px] w-full flex justify-end">
        <Button
          className={`!w-full md:!w-fit !shadow-none !rounded-[4px] !gap-[4px] !text-[#EFEFEF] !text-[14px] md:!text-[16px] !font-medium
            ${!checkAllValues(data.office) && "opacity-60"}`}
          disabled={!checkAllValues(data.office)}
          onClick={() => setValue((prev) => prev + 1)}
          variant="contained"
        >
          ثبت اطلاعات
          <div
            className={
              !checkAllValues(data.office) ? "opacity-40" : "opacity-100"
            }
          >
            <ArrowLeftPA />
          </div>
        </Button>
      </div>
    </div>
  );
}

export default OfficeInformation;
