refactor Form module

This commit is contained in:
Alexander Foremny
2024-06-04 09:28:10 +02:00
parent a19623cc78
commit 342ebdf61b
5 changed files with 109 additions and 85 deletions

View File

@@ -0,0 +1,26 @@
module Form.Input
( string,
)
where
import Data.Text qualified as T
import Form.Internal
import Miso
import Miso.String (toMisoString)
string :: String -> Form T.Text T.Text
string label =
Form
{ view = \i ->
[ div_ [] $
[ label_ [] $
[ text (toMisoString label),
input_
[ type_ "text",
value_ (toMisoString i)
]
]
]
],
fill = \i -> Right i
}