File size: 817 Bytes
d092f57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
37
38
39
40
41
42
43
import { FC, ReactNode } from "react"
import Navbar from "./Navbar"
import NoScriptAlert from "./alert/NoScriptAlert"
import Footer from "./Footer"
import Head, { MetaProps } from "./Head"

interface Props {
  meta: MetaProps
  showNavbar?: boolean
  error?: number
  roomId?: string
  children?: ReactNode
}

const Layout: FC<Props> = ({
  meta,
  showNavbar = true,
  error,
  roomId,
  children,
}) => {
  return (
    <div className={"flex flex-col min-h-screen"}>
      <Head customMeta={meta} />
      {showNavbar && (
        <header>
          <Navbar roomId={roomId} />
        </header>
      )}

      <noscript>
        <NoScriptAlert />
      </noscript>

      <main className={"relative flex flex-col grow p-2"}>{children}</main>

      <Footer error={error} />
    </div>
  )
}

export default Layout