all repos

onasty @ b8e61c9

a one-time notes service

onasty/web/src/Components/Box.elm (view raw)

Olexandr Smirnov Olexandr Smirnov
ss2316544@gmail.com
feat(web): add account settings (#190)..., 9 months ago
1
module Components.Box exposing (error, success, successBox, successText)
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
successText : String -> Html msg
22
successText text =
23
    successBox [ H.p [ A.class "text-green-800 text-sm" ] [ H.text text ] ]
24
25
26
successBox : List (Html msg) -> Html msg
27
successBox child =
28
    H.div [ A.class "bg-green-50 border border-green-200 rounded-md p-4" ] child