Copy/paste form together

This commit is contained in:
Eike Kettner
2020-04-19 23:46:46 +02:00
parent ad772c0c25
commit 9b30542974
8 changed files with 275 additions and 36 deletions

View File

@ -0,0 +1,22 @@
module Util.Tag exposing (makeDropdownModel)
import Api.Model.Tag exposing (Tag)
import Comp.Dropdown
import Util.Maybe
makeDropdownModel : Comp.Dropdown.Model Tag
makeDropdownModel =
Comp.Dropdown.makeModel
{ multiple = True
, searchable = \n -> n > 4
, makeOption = \tag -> { value = tag.id, text = tag.name }
, labelColor =
\tag ->
if Util.Maybe.nonEmpty tag.category then
"basic blue"
else
""
, placeholder = "Choose a tag"
}