use maud::{Markup, Render, html};
use strum::{Display, EnumString};

#[derive(Debug, Clone, Copy, EnumString, Display)]
#[strum(serialize_all = "snake_case")]
pub enum FAIcon {
	Github,
	Git,
	Python,
	Rust,
	Discord,
	Instagram,

	Link,
	Envelope,
	At,
	Key,
	SStar,
	RStar,
	Leaf,

	Lock,
	Fire,
	Pen,
	Pencil,
}

impl Render for FAIcon {
	fn render(&self) -> Markup {
		let classes = match self {
			Self::Github => "fa-brands fa-github",
			Self::Git => "fa-brands fa-git-alt",
			Self::Python => "fa-brands fa-python",
			Self::Rust => "fa-brands fa-rust",
			Self::Discord => "fa-brands fa-discord",
			Self::Instagram => "fa-brands fa-instagram",
			Self::Link => "fa-solid fa-link",
			Self::Envelope => "fa-solid fa-envelope",
			Self::At => "fa-solid fa-at",
			Self::Key => "fa-solid fa-key",
			Self::SStar => "fa-solid fa-star",
			Self::RStar => "fa-regular fa-star",
			Self::Leaf => "fa-regular fa-leaf",
			Self::Lock => "fa-solid fa-lock",
			Self::Fire => "fa-solid fa-fire",
			Self::Pen => "fa-solid fa-pen-nib",
			Self::Pencil => "fa-solid fa-pencil",
		};

		html!(
			i
				class=(classes)
				style="margin-right:5pt" // TODO: configure, color
				{}
		)
	}
}
