module Taskell.UI.Draw.Types where

import ClassyPrelude

import Brick (Widget)

import Taskell.Events.State.Types (State)
import Taskell.IO.Config.Layout   (Config)
import Taskell.IO.Keyboard.Types  (Bindings)
import Taskell.UI.Types           (ResourceName)

data DrawState = DrawState
    { DrawState -> Config
dsLayout   :: Config
    , DrawState -> Bindings
dsBindings :: Bindings
    , DrawState -> Bool
dsDebug    :: Bool
    , DrawState -> State
dsState    :: State
    }

-- | Use a Reader to pass around DrawState
type ReaderDrawState = ReaderT DrawState Identity

-- | Aliases for common combinations
type TWidget = Widget ResourceName

type ModalWidget = ReaderDrawState (Text, TWidget)

type DSWidget = ReaderDrawState TWidget