"use client";
import DenyAccess from "@/components/DenyAccess";
import CreateTransferPackageForm from "@/components/forms/transfer-packages/new/CreateTransferPackageForm";
import Loader from "@/components/Loader";
import { useGetLanguages } from "@/hooks/languages";
import React, { Suspense } from "react";

export default function Page() {
  const { data } = useGetLanguages();
  return (
    <div>
      <Suspense fallback={<Loader />}>
        {data ? (
          data?.data?.length > 0 ? (
            <CreateTransferPackageForm
              createPending={false}
              languages={data?.data}
            />
          ) : (
            <DenyAccess label="زبان" link="/languages" />
          )
        ) : (
          <div>خطا در دریافت دیتای زبان ها</div>
        )}
      </Suspense>
    </div>
  );
}
