import { hexToNpub } from '../utils'

export const appPrivateRoutes = {
  homePage: '/',
  create: '/create',
  sign: '/sign',
  settings: '/settings',
  profileSettings: '/settings/profile/:npub',
  cacheSettings: '/settings/cache',
  relays: '/settings/relays',
  servers: '/settings/servers',
  nostrLogin: '/settings/nostrLogin'
}

export const appPublicRoutes = {
  profile: '/profile/:npub',
  landingPage: '/',
  login: '/login',
  register: '/login/register',
  nostr: '/login/nostr',
  verify: '/verify',
  source: 'https://git.sigit.io/sig/it',
  docs: 'https://docs.sigit.io'
}

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

export const getProfileSettingsRoute = (hexKey: string) =>
  appPrivateRoutes.profileSettings.replace(':npub', hexToNpub(hexKey))
