module IHP.Breadcrumb.Types where
import IHP.Prelude
import Text.Blaze.Html (Html)
import Text.Blaze.Html.Renderer.String (renderHtml)
import ClassyPrelude
data BreadcrumbItem =
BreadcrumbItem
{ BreadcrumbItem -> Html
breadcrumbLabel :: Html
, BreadcrumbItem -> Maybe Text
url :: Maybe Text
}
instance Show BreadcrumbItem where
show :: BreadcrumbItem -> String
show BreadcrumbItem
breadcrumbItem = [plain|{ breadcrumbLabel = "#{breadcrumbLabel}", url = #{url} }|]
where
breadcrumbLabel :: String
breadcrumbLabel = Html -> String
renderHtml (Html -> String) -> Html -> String
forall a b. (a -> b) -> a -> b
$ BreadcrumbItem
breadcrumbItem.breadcrumbLabel
url :: String
url = Maybe Text -> String
forall a. Show a => a -> String
ClassyPrelude.show (Maybe Text -> String) -> Maybe Text -> String
forall a b. (a -> b) -> a -> b
$ BreadcrumbItem
breadcrumbItem.url