mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-26 20:49:11 +00:00
21 lines
646 B
TypeScript
21 lines
646 B
TypeScript
import * as React from 'react'
|
|
import dynamic from 'next/dynamic'
|
|
import { User } from '../stores/user'
|
|
import HeaderBarAuthT from '../components/header/auth'
|
|
import HeaderBarUnauthT from '../components/header/unauth'
|
|
type Props = {
|
|
user?: User
|
|
}
|
|
|
|
const HeaderBarAuth = dynamic<typeof HeaderBarAuthT>(() => import('../components/header/auth'))
|
|
const HeaderBarUnauth = dynamic<typeof HeaderBarUnauthT>(() => import('../components/header/unauth'))
|
|
|
|
const HeaderBar = (props: Props) => {
|
|
if (props.user === undefined) {
|
|
return <HeaderBarUnauth {...props} />
|
|
} else {
|
|
return <HeaderBarAuth {...props} />
|
|
}
|
|
}
|
|
|
|
export default HeaderBar
|