use v6.e.PREVIEW;
unit module Render::Foot;

use HTML::Functional;

use Render::Util;
use DB::BlogMeta;

sub footer-link($name, $title, $path, $icon) {
    div :class<footer-link>, [
       $icon;
       a :href($path), :title($title), [
          $name;
       ]
    ]
}

sub generate-footer() is export {
    footer [
        div :class<contact>, [
            div :class<footer-title>, span "Contact Me";
            div :class<footer-links>, [
                footer-link (^ "Discord"),
                    "Discord",
                    "https://discordapp.com/users/thatonelutenist",
                    simple-icon "discord";
                footer-link (^ "Matrix"),
                    "Matrix",
                    "https://matrix.to/#/@thatonelutenist:stranger.systems",
                    simple-icon "matrix";
                footer-link (^ "Public Email Inbox"),
                    "Email",
                    "mailto:~thatonelutenist/public-inbox@lists.sr.ht",
                    icon-solid "envelope";
            ];
        ];
        div :class<code>, [
            div :class<footer-title>, span "Find My Code";
            div :class<footer-links>, [
                footer-link "git.stranger.systems",
                    "Stranger Systems Forgejo",
                    "https://git.stranger.systems/explore/repos",
                    simple-icon "forgejo";
                footer-link (^ "sr.ht"),
                    "sr.ht",
                    "https://sr.ht/~thatonelutenist/",
                    simple-icon "sourcehut";
                footer-link (^ "Github"),
                    "Github",
                    "https://github.com/nmccarty",
                    simple-icon "github";
                footer-link (^ "Gitlab"),
                    "Gitlab",
                    "https://gitlab.com/thatonelutenist",
                    simple-icon "gitlab";
            ];
        ];
        div :class<socials>, [
            div :class<footer-title>, span "Social Media";
            div :class<footer-links>, [
                footer-link "Mastodon",
                    "Mastodon",
                    "https://hachyderm.io/@thatonelutenist",
                    simple-icon "mastodon";
            ];
        ]
    ]
}