module Matterhorn.Draw.MessageDeleteConfirm
  ( drawMessageDeleteConfirm
  )
where

import Prelude ()
import Matterhorn.Prelude

import           Brick
import           Brick.Widgets.Border
import           Brick.Widgets.Center
import qualified Data.Text as T

import           Matterhorn.Types
import           Matterhorn.Themes


drawMessageDeleteConfirm :: Widget Name
drawMessageDeleteConfirm :: Widget Name
drawMessageDeleteConfirm =
    let msg :: Text
msg = Text
"Are you sure you want to delete the selected message? (y/n)"
    in Widget Name -> Widget Name
forall n. Widget n -> Widget n
centerLayer (Widget Name -> Widget Name) -> Widget Name -> Widget Name
forall a b. (a -> b) -> a -> b
$
       Widget Name -> Widget Name -> Widget Name
forall n. Widget n -> Widget n -> Widget n
borderWithLabel (AttrName -> Widget Name -> Widget Name
forall n. AttrName -> Widget n -> Widget n
withAttr AttrName
channelListHeaderAttr (Widget Name -> Widget Name) -> Widget Name -> Widget Name
forall a b. (a -> b) -> a -> b
$ Text -> Widget Name
forall n. Text -> Widget n
txt Text
"Confirm") (Widget Name -> Widget Name) -> Widget Name -> Widget Name
forall a b. (a -> b) -> a -> b
$
       Int -> Widget Name -> Widget Name
forall n. Int -> Widget n -> Widget n
hLimit (Text -> Int
T.length Text
msg Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
4) (Widget Name -> Widget Name) -> Widget Name -> Widget Name
forall a b. (a -> b) -> a -> b
$
       Int -> Widget Name -> Widget Name
forall n. Int -> Widget n -> Widget n
vLimit Int
3 (Widget Name -> Widget Name) -> Widget Name -> Widget Name
forall a b. (a -> b) -> a -> b
$
       Widget Name -> Widget Name
forall n. Widget n -> Widget n
center (Widget Name -> Widget Name) -> Widget Name -> Widget Name
forall a b. (a -> b) -> a -> b
$
       AttrName -> Widget Name -> Widget Name
forall n. AttrName -> Widget n -> Widget n
withDefAttr AttrName
errorMessageAttr (Widget Name -> Widget Name) -> Widget Name -> Widget Name
forall a b. (a -> b) -> a -> b
$
       Text -> Widget Name
forall n. Text -> Widget n
txt Text
msg