You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

46 lines
1.4 KiB

  1. //src\components\LateStartReportGen\LateStartReportGen.tsx
  2. "use client";
  3. import React, { useMemo, useState } from "react";
  4. import SearchBox, { Criterion } from "../../ReportSearchBox3";
  5. import { useTranslation } from "react-i18next";
  6. import { ResourceOverconsumption } from "@/app/api/report3";
  7. interface Props {
  8. projects: ResourceOverconsumption[];
  9. }
  10. type SearchQuery = Partial<Omit<ResourceOverconsumption, "id">>;
  11. type SearchParamNames = keyof SearchQuery;
  12. const ProgressByClientSearch: React.FC<Props> = ({ projects }) => {
  13. const { t } = useTranslation("projects");
  14. const searchCriteria: Criterion<SearchParamNames>[] = useMemo(
  15. () => [
  16. { label: "Team", paramName: "team", type: "select", options: ["AAA", "BBB", "CCC"] },
  17. { label: "Client", paramName: "client", type: "select", options: ["Cust A", "Cust B", "Cust C"] },
  18. { label: "Status", paramName: "status", type: "select", options: ["Overconsumption", "Potential Overconsumption"] },
  19. // {
  20. // label: "Status",
  21. // label2: "Remained Date To",
  22. // paramName: "targetEndDate",
  23. // type: "dateRange",
  24. // },
  25. ],
  26. [t],
  27. );
  28. return (
  29. <>
  30. <SearchBox
  31. criteria={searchCriteria}
  32. onSearch={(query) => {
  33. console.log(query);
  34. }}
  35. />
  36. {/* <DownloadReportButton /> */}
  37. </>
  38. );
  39. };
  40. export default ProgressByClientSearch;