Skip to content

Commit

Permalink
refactor: simplify conditional rendering in Inputs component
Browse files Browse the repository at this point in the history
  • Loading branch information
GiridharRNair committed Jan 15, 2025
1 parent 91f550d commit e2f4126
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Inputs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ function Inputs({ setProfessor, setCourse, professor, course, isCompareInputs =
{(course.trim() || professor.trim() ? courseSuggestions : getLastQueriedCourses()).map((courseOption, index) => (
<AutoCompleteItem value={courseOption} key={index} justify="space-between" align="center">
{courseOption}
{!course.trim() && !professor.trim() && JSON.stringify(getLastQueriedCourses()) !== JSON.stringify(DEFAULT_COURSE_SUGGESTIONS) && (
<RepeatClockIcon />
)}
{!course.trim() &&
!professor.trim() &&
JSON.stringify(getLastQueriedCourses()) !== JSON.stringify(DEFAULT_COURSE_SUGGESTIONS) && <RepeatClockIcon />}
</AutoCompleteItem>
))}
</AutoCompleteList>
Expand Down

0 comments on commit e2f4126

Please sign in to comment.