docspell/modules/webapp/src/main/elm/Data/SourceState.elm
2019-12-29 21:55:12 +01:00

42 lines
582 B
Elm

module Data.SourceState exposing
( SourceState(..)
, all
, fromString
, toString
)
type SourceState
= Active
| Disabled
fromString : String -> Maybe SourceState
fromString str =
case String.toLower str of
"active" ->
Just Active
"disabled" ->
Just Disabled
_ ->
Nothing
all : List SourceState
all =
[ Active
, Disabled
]
toString : SourceState -> String
toString dir =
case dir of
Active ->
"Active"
Disabled ->
"Disabled"