Created
November 4, 2018 20:28
-
-
Save ufocoder/96732371e7cccfe080bf673ca7992d6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| renderRow : String -> Int -> Html Msg | |
| renderRow title data = | |
| tr [] | |
| [ td [] [ text title ] | |
| , td | |
| [ style | |
| [ ( "text-align", "right" ) | |
| , ( "min-width", "5rem" ) | |
| ] | |
| ] | |
| [ data |> toString |> text ] | |
| ] | |
| viewReport : LibraryReport -> Html Msg | |
| viewReport report = | |
| div | |
| [ style | |
| [ ( "background-color", "#eee" ) | |
| , ( "padding", "3px" ) | |
| , ( "margin", "3rem" ) | |
| ] | |
| ] | |
| [ b [] [ text "Library Report" ] | |
| , table [] | |
| [ renderRow "Number of Books" report.numBooks | |
| , renderRow "Oldest Copyright" report.oldestCopyright | |
| , renderRow "Newest Copyright" report.newestCopyright | |
| , renderRow "Number of Unique Authors " report.uniqueAuthors | |
| ] | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment