onasty/web/src/Components/Icon.elm(view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
module Components.Icon exposing (IconType(..), view)
import Html as H exposing (Html)
import Html.Attributes as A
type IconType
= NoteIcon
| NotFound
| Warning
view : IconType -> String -> Html msg
view t cls =
let
getHtml img =
H.img [ A.src ("/static/" ++ img ++ ".svg"), A.class cls ] []
in
case t of
NoteIcon ->
getHtml "note-icon"
NotFound ->
getHtml "note-not-found"
Warning ->
getHtml "warning"
|