module Hydra.TUI.Style where

import Brick (
  AttrMap,
  AttrName,
  attrMap,
  attrName,
  fg,
 )
import Brick.Forms (focusedFormInputAttr, invalidFormInputAttr)
import Graphics.Vty (
  brightBlue,
  defAttr,
  green,
  red,
  yellow,
 )
import Hydra.TUI.Logging.Types (Severity (..))

severityToAttr :: Severity -> AttrName
severityToAttr :: Severity -> AttrName
severityToAttr = \case
  Severity
Success -> AttrName
positive
  Severity
Info -> AttrName
infoA
  Severity
Error -> AttrName
negative

infoA :: AttrName
infoA :: AttrName
infoA = String -> AttrName
attrName String
"info"

positive :: AttrName
positive :: AttrName
positive = String -> AttrName
attrName String
"positive"

negative :: AttrName
negative :: AttrName
negative = String -> AttrName
attrName String
"negative"

own :: AttrName
own :: AttrName
own = String -> AttrName
attrName String
"own"

style :: s -> AttrMap
style :: forall s. s -> AttrMap
style s
_ =
  Attr -> [(AttrName, Attr)] -> AttrMap
attrMap
    Attr
defAttr
    [ (AttrName
infoA, Color -> Attr
fg Color
brightBlue)
    , (AttrName
negative, Color -> Attr
fg Color
red)
    , (AttrName
positive, Color -> Attr
fg Color
green)
    , (AttrName
own, Color -> Attr
fg Color
yellow)
    , -- Brick forms
      (AttrName
focusedFormInputAttr, Color -> Attr
fg Color
brightBlue)
    , (AttrName
invalidFormInputAttr, Color -> Attr
fg Color
red)
    ]