11// @ts -check
2- /* eslint no-use-before-define: 0 */
32import PropTypes from "prop-types" ;
43import React , { useState , useEffect } from "react" ;
54
@@ -24,7 +23,7 @@ import { WebDirLayout, FacultyRankLayout } from "./index.styles";
2423 * @param {string } props.searchApiVersion - The version of the search API to use.
2524 * @param {string } props.profileURLBase - The base URL for profile links.
2625 * @param {string } props.appPathFolder - The base path for the application folder.
27- * @param {object } props.display - Display options for the search results.
26+ * @param {Record<string, any> } props.display - Display options for the search results.
2827 * @param {Object } props.filters - Filters for the search.
2928 * @param {string } props.alphaFilter - Indicates whether to enable alpha filtering.
3029 * @returns {JSX.Element } The WebDirectory component.
@@ -45,7 +44,7 @@ function WebDirectory({
4544 const [ sort , setSort ] = useState ( defaultSortSetter ) ;
4645 const [ requestFilters , setRequestFilters ] = useState ( doSearch ) ;
4746 const [ gridView , setGridView ] = useState (
48- display . grid === "true" || display . grid === true
47+ display ? .grid === "true" || display ? .grid === true
4948 ) ;
5049 const RES_PER_PAGE = 6 ;
5150
@@ -65,6 +64,7 @@ function WebDirectory({
6564
6665 // Initializer functions for requestFilters and sort. Only runs on first render.
6766 function doSearch ( ) {
67+ /** @type {Record<string, any> } */
6868 const tempFilters = filters ? { ...filters } : { } ;
6969 if ( searchType === "departments" || searchType === "faculty_rank" ) {
7070 tempFilters [ "deptIds" ] = deptIds . split ( "," ) ;
@@ -96,7 +96,11 @@ function WebDirectory({
9696 return "last_name_asc" ; // defaults to last_name_asc if no default sort is set in CMS
9797 }
9898
99- // Function returns an array of custom sort options based on the webDirSearchType and departmentIds parameters.
99+ /**
100+ * Function returns an array of custom sort options based on the webDirSearchType and departmentIds parameters.
101+ * @param {string } webDirSearchType
102+ * @param {string } departmentIds
103+ */
100104 function sortOptionsFunc ( webDirSearchType , departmentIds ) {
101105 if (
102106 webDirSearchType === "departments" &&
@@ -139,7 +143,7 @@ function WebDirectory({
139143 ...engineParams ,
140144 } ,
141145 [ engineNames . WEB_DIRECTORY_FACULTY_RANK ] : {
142- ...engines [ engineNames . WEB_DIRECTORY_FACULTY__RANK ] ,
146+ ...engines [ engineNames . WEB_DIRECTORY_FACULTY_RANK ] ,
143147 ...engineParams ,
144148 deptIds,
145149 display,
0 commit comments