module Clckwrks.Admin.Route where

import Clckwrks                    (AdminURL(..), Clck, ClckURL(..), Response, nestURL)
import Clckwrks.Admin.Console      (consolePage)
import Clckwrks.Admin.EditSettings (editSettings)
import Clckwrks.NavBar.EditNavBar  (editNavBar, navBarPost)
import Clckwrks.Admin.SystemEmails (systemEmailsPage)

-- | routes for 'AdminURL'
routeAdmin :: AdminURL -> Clck ClckURL Response
routeAdmin :: AdminURL -> Clck ClckURL Response
routeAdmin AdminURL
url =
    case AdminURL
url of
      AdminURL
Console           -> (AdminURL -> ClckURL)
-> ClckT AdminURL (ServerPartT IO) Response
-> Clck ClckURL Response
forall url1 url2 (m :: * -> *) a.
(url1 -> url2) -> ClckT url1 m a -> ClckT url2 m a
nestURL AdminURL -> ClckURL
Admin (ClckT AdminURL (ServerPartT IO) Response -> Clck ClckURL Response)
-> ClckT AdminURL (ServerPartT IO) Response
-> Clck ClckURL Response
forall a b. (a -> b) -> a -> b
$ ClckT AdminURL (ServerPartT IO) Response
consolePage
      AdminURL
EditSettings      -> ClckURL -> Clck ClckURL Response
editSettings (AdminURL -> ClckURL
Admin AdminURL
url)
      AdminURL
EditNavBar        -> Clck ClckURL Response
editNavBar
      AdminURL
NavBarPost        -> Clck ClckURL Response
navBarPost
      AdminURL
SystemEmails      -> ClckURL -> Clck ClckURL Response
systemEmailsPage (AdminURL -> ClckURL
Admin AdminURL
url)