onasty/web/src/Components/Box.elm (view raw)
| 1 | module Components.Box exposing (error, success, successBox) |
| 2 | |
| 3 | import Html as H exposing (Html) |
| 4 | import Html.Attributes as A |
| 5 | |
| 6 | |
| 7 | error : String -> Html msg |
| 8 | error errorMsg = |
| 9 | H.div [ A.class "bg-red-50 border border-red-200 rounded-md p-4" ] |
| 10 | [ H.p [ A.class "text-red-800 text-sm" ] [ H.text errorMsg ] ] |
| 11 | |
| 12 | |
| 13 | success : { header : String, body : String } -> Html msg |
| 14 | success opts = |
| 15 | successBox |
| 16 | [ H.div [ A.class "font-medium text-green-800 mb-2" ] [ H.text opts.header ] |
| 17 | , H.p [ A.class "text-green-800 text-sm" ] [ H.text opts.body ] |
| 18 | ] |
| 19 | |
| 20 | |
| 21 | successBox : List (Html msg) -> Html msg |
| 22 | successBox child = |
| 23 | H.div [ A.class "bg-green-50 border border-green-200 rounded-md p-4" ] child |