import React from "react";
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
import { useColumns } from "./useTableColumns";
import useSearchQuery from "../../../api/utils/useSearchQuery";
import { useGetAllPackage } from "../../../api/package";
import { useGetAllPackageItem } from "../../../api/packageItem";
import { useParams } from "react-router-dom";
import { ParamsEnum } from "../../../enums/params";
const App: React.FC = () => {
  const [searchQuery] = useSearchQuery("name");
  const {package_id} = useParams<ParamsEnum>()
  const response = useGetAllPackageItem({
    name: searchQuery,
    package_id:package_id,
    pagination: true,
  });

  return <DataTable response={response} useColumns={useColumns} />;
};

export default App;
