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 != null && searchResults.length !== 0 ? ( <>

{searchResults.length} Colleagues are found!


) : ( <>

No one is found!


No one is found! )}
); } export default Results; component.tsx: "use client"; import React from "react"; import SearchCard from "../search-card/SearchCard"; import styles from "./SearchResults.module.scss"; export interface SearchResult { skillName: string; skillLevel: number; lastUsed: string; comment: string; userName: string; userTitle: string; userPFP: string; } export interface Response { category: string; results: SearchResult[]; } export interface SearchResultsProps { data: Response[]; } const SearchResults = ({ data }: SearchResultsProps) => { return (
{data.map((i, index) => (

{i.category}

{i.results.map((r, resultIndex) => ( ))}
))}
); }; export default SearchResults;