import { LandingPage } from '../pages/landing/LandingPage'
import { Login } from '../pages/login'
import { Nsecbunker } from '../pages/nsecbunker'
import { ProfilePage } from '../pages/profile'
import { hexToNpub } from '../utils'

export const appPrivateRoutes = {
  homePage: '/',
  nsecbunker: '/nsecbunker'
}

export const appPublicRoutes = {
  profile: '/profile/:npub',
  login: '/login',
  help: 'https://help.sigit.io'
}

export const getProfileRoute = (hexKey: string) =>
  appPublicRoutes.profile.replace(':npub', hexToNpub(hexKey))

export const publicRoutes = [
  {
    path: appPublicRoutes.login,
    hiddenWhenLoggedIn: true,
    element: <Login />
  },
  {
    path: appPublicRoutes.profile,
    element: <ProfilePage />
  }
]

export const privateRoutes = [
  {
    path: appPrivateRoutes.homePage,
    element: <LandingPage />
  },
  {
    path: appPrivateRoutes.nsecbunker,
    element: <Nsecbunker />
  }
]
