module Services.Helpers exposing (..)

import Config.Colour exposing (..)
import Config.Format exposing (..)
import Effect exposing (Effect)
import Element exposing (..)
import Element.Border as D
import Element.Font as F
import Html.Attributes as H exposing (style)
import Layouts
import Page exposing (Page)
import Route exposing (Route)
import Services.Types exposing (..)
import Shared
import View exposing (View)


servicesImageFormat : List (Attribute msg)
servicesImageFormat =
    [ width <| px 100
    , alignTop
    ]


serviceMaker : Service -> Element msg
serviceMaker service =
    row [ imageSpacer ]
        [ image servicesImageFormat
            { src = "services/" ++ service.logoImage ++ ".png"
            , description = service.logoDescription
            }
        , column paragraphColumnFormat
            [ row [ spacing 8 ]
                [ newTabLink highlightedTitleFormat
                    { url = service.servicesLink
                    , label =
                        transitionHighlightedLinkHover <|
                            text service.servicesTitle
                    }
                , paragraph [ F.color colourTheme.nonHighlightedText ] [ text service.servicesRate ]
                ]
            , paragraph paragraphFormat [ text service.servicesDescription ]
            ]
        ]
