module Headers.Helpers exposing (..)

import Config.CardFormat exposing (..)
import Config.Colour exposing (..)
import Config.Format exposing (..)
import Config.StrengthBar exposing (..)
import Config.ToolTip exposing (..)
import Effect exposing (Effect)
import Element as E exposing (..)
import Element.Background as B exposing (..)
import Element.Border as D
import Element.Font as F
import Headers.Types exposing (..)
import Html.Attributes as H exposing (style)
import Interviews.Types exposing (..)
import Layouts
import Page exposing (Page)
import Route exposing (Route)
import Shared
import View exposing (View)


headerMaker : Header -> Element msg
headerMaker header =
    row
        topLevelBox
        [ column
            [ E.width fill

            -- E.width <| px 785
            , D.width 5
            , D.color colourTheme.backgroundDarkGrey
            , D.roundEach
                { topLeft = 32
                , topRight = 32
                , bottomRight = 32
                , bottomLeft = 32
                }
            , glow
            ]
            [ paragraph
                (nonHighlightedTitleFormat
                    ++ [ F.size 20
                       , B.color colourTheme.textDarkOrange
                       , paddingEach
                            { top = 6
                            , bottom = 3
                            , left = 25
                            , right = 15
                            }
                       , alignBottom
                       , width fill
                       , F.center
                       , D.roundEach
                            { topLeft = 26
                            , topRight = 26
                            , bottomRight = 0
                            , bottomLeft = 0
                            }
                       ]
                )
                [ text header.headerTitle ]
            , cardFormatter
                [ cardContentSpacing
                    [ column
                        fieldSpacer
                        [ paragraph
                            (paragraphFormat
                                ++ [ F.size 18
                                   , F.center
                                   ]
                            )
                            [ text header.headerBody ]
                        ]
                    ]
                ]
            ]
        ]


headerTitle : Header -> String
headerTitle header =
    header.headerTitle
