"use client"; import { ProjectResult } from "@/app/api/projects"; import React, { useMemo, useState } from "react"; import SearchBox, { Criterion } from "../SearchBox"; import { useTranslation } from "react-i18next"; import SearchResults, { Column } from "../SearchResults"; import { TeamProjectResult } from "@/app/api/teamprojects"; interface Props { projects: TeamProjectResult[]; } type SearchQuery = Partial>; type SearchParamNames = keyof SearchQuery; const ProgressByClientSearch: React.FC = ({ projects }) => { const { t } = useTranslation("projects"); // If project searching is done on the server-side, then no need for this. const [filteredProjects, setFilteredProjects] = useState(projects); const searchCriteria: Criterion[] = useMemo( () => [ { label: "Team Code", paramName: "teamCode", type: "text" }, { label: "Team Name", paramName: "teamName", type: "text" }, ], [t], ); const columns = useMemo[]>( () => [ { name: "teamCode", label: t("Team Code") }, { name: "teamName", label: t("Team Name") }, { name: "NoOfProjects", label: t("No. of Projects") }, ], [t], ); return ( <> { console.log(query); }} /> items={filteredProjects} columns={columns} /> ); }; export default ProgressByClientSearch;