source: reactapp/src/Pages/SearchResults.js

main
Last change on this file was 9bf1f8d, checked in by viktor <viktor@…>, 21 months ago

prefinal

  • Property mode set to 100644
File size: 1.2 KB
Line 
1import React from "react";
2import { useLocation } from "react-router";
3import {
4 SearchResultText,
5 SearchResultsWrapper,
6 SearchResult,
7 SearchResultLink,
8} from "../Components/Styled/Search.style";
9
10function SearchResults() {
11 const location = useLocation();
12
13 return (
14 <SearchResultsWrapper>
15 <h3 style={{ marginBottom: "30px" }}>Резултати од пребарувањето:</h3>
16 {location.state.map((match) => (
17 <SearchResult key={match.professorId !== undefined ? match.professorId : match.subjectId} margin="10px">
18 <SearchResultLink href={`/${match.professorId !== undefined ? 'professor': 'subject'}/` + `${match.professorId !== undefined ? match.professorId : match.subjectId}`}>
19 <SearchResultText weight="bold" size="medium">
20 {match.professorId !== undefined ? match.professorName : match.subjectName}
21 </SearchResultText>
22 <SearchResultText weight="normal" size="er">
23 {match.professorId !== undefined ? match.faculty.facultyName : match.studyProgramme.faculty.facultyName}
24 </SearchResultText>
25 </SearchResultLink>
26 </SearchResult>
27 ))}
28 </SearchResultsWrapper>
29 );
30}
31
32export default SearchResults;
Note: See TracBrowser for help on using the repository browser.