page.tsx:
import SearchResults, {
Response,
} from "../components/search-results/SearchResults";
import styles from "./page.module.scss";
import Image from "next/image";
import { use } from "react";
export interface ResultsProps {
searchResults: Response[];
}
async function search() {
let res = await fetch(
`http://address/api/Search?searchString=figma`
);
console.log("Response " + res);
return res;
}
function Results({ searchResults }: ResultsProps) {
let { data } = use(search());
console.log("DATA " + data);
return (
{searchResults.length} Colleagues are found!
No one is found!