mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-27 13:02:42 +03:00
20 lines
518 B
Elm
20 lines
518 B
Elm
module ViewHelpers exposing (viewExamples)
|
|
|
|
import Css
|
|
import Html.Styled as Html exposing (Html)
|
|
import Html.Styled.Attributes exposing (css)
|
|
|
|
|
|
viewExamples : List ( String, Html msg ) -> Html msg
|
|
viewExamples examples =
|
|
let
|
|
viewExample ( name, view ) =
|
|
Html.tr []
|
|
[ Html.th [] [ Html.text name ]
|
|
, Html.td [] [ view ]
|
|
]
|
|
in
|
|
Html.table [ css [ Css.width (Css.pct 100) ] ]
|
|
[ Html.tbody [] (List.map viewExample examples)
|
|
]
|