blob: 7912b80ee544247d83fc4fbe87dfdbc9cb255a98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import { useLoaderData } from "react-router-dom";
import CompanyDetails from "../../components/company_details";
import MainContentLayout from "../../components/main_content_layout";
import SearchBar from "../../components/search_bar";
export default function Companies(){
const companies = useLoaderData().data.data.map(company =>
<li key={company.id}>
<CompanyDetails company={company}/>
</li>
);
return(
<>
<MainContentLayout>
<SearchBar path="/companies"/>
<ul>
{companies}
</ul>
</MainContentLayout>
</>
);
}
|