mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 02:59:45 +00:00
27 lines
607 B
React
Executable File
27 lines
607 B
React
Executable File
import { Outlet, useLoaderData } from "react-router-dom";
|
|
|
|
import { getContacts } from "../../api";
|
|
import Navbar from '../../components/Navbar';
|
|
import UsersWP from "../../components/UsersWP";
|
|
import './Root.styles.scss';
|
|
|
|
async function loader() {
|
|
const contacts = await getContacts();
|
|
return { contacts };
|
|
}
|
|
|
|
function Root() {
|
|
const { contacts } = useLoaderData();
|
|
return (
|
|
<>
|
|
<Navbar />
|
|
<div id="page">
|
|
<Outlet />
|
|
</div>
|
|
<UsersWP contacts={ contacts } />
|
|
</>
|
|
);
|
|
}
|
|
|
|
export { loader };
|
|
export default Root; |