-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdminLayout.tsx
36 lines (32 loc) · 929 Bytes
/
AdminLayout.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import Head from "next/head";
import { useRouter } from "next/router";
import { FC, PropsWithChildren } from "react";
import styled from "styled-components";
import Footer from "../components/Footer";
import HeaderAdmin from "../components/HeaderAdmin";
import { main } from "../locales/main";
const AdminContainer = styled.main`
padding: 24px 0;
flex: 1 1 auto;
width: 100%;
max-width: 1140px;
margin: 0 auto;
`;
const AdminLayout: FC<PropsWithChildren> = (props) => {
const { children } = props;
const router = useRouter();
const locale = router.locale || "ru";
return (
<>
<Head>
<title>{main[locale].admin}</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>
<HeaderAdmin />
<AdminContainer>{children}</AdminContainer>
<Footer />
</>
);
};
export default AdminLayout;