main
Rev | Line | |
---|
[3e98cea] | 1 | import React from "react";
|
---|
| 2 | import { useLocation } from "react-router";
|
---|
| 3 | import {
|
---|
| 4 | SearchResultText,
|
---|
| 5 | SearchResultsWrapper,
|
---|
| 6 | SearchResult,
|
---|
| 7 | SearchResultLink,
|
---|
| 8 | } from "../Components/Styled/Search.style";
|
---|
| 9 |
|
---|
| 10 | function SearchResults() {
|
---|
| 11 | const location = useLocation();
|
---|
| 12 |
|
---|
| 13 | return (
|
---|
| 14 | <SearchResultsWrapper>
|
---|
| 15 | <h3 style={{ marginBottom: "30px" }}>Резултати од пребарувањето:</h3>
|
---|
[9bf1f8d] | 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}`}>
|
---|
[3e98cea] | 19 | <SearchResultText weight="bold" size="medium">
|
---|
[9bf1f8d] | 20 | {match.professorId !== undefined ? match.professorName : match.subjectName}
|
---|
[3e98cea] | 21 | </SearchResultText>
|
---|
| 22 | <SearchResultText weight="normal" size="er">
|
---|
[9bf1f8d] | 23 | {match.professorId !== undefined ? match.faculty.facultyName : match.studyProgramme.faculty.facultyName}
|
---|
[3e98cea] | 24 | </SearchResultText>
|
---|
| 25 | </SearchResultLink>
|
---|
| 26 | </SearchResult>
|
---|
| 27 | ))}
|
---|
| 28 | </SearchResultsWrapper>
|
---|
| 29 | );
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | export default SearchResults;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.