{
props.wolves.iter().map(|w| html!{
diff --git a/werewolves/src/components/attributes/align_span.rs b/werewolves/src/components/attributes/align_span.rs
index 629eb67..08413be 100644
--- a/werewolves/src/components/attributes/align_span.rs
+++ b/werewolves/src/components/attributes/align_span.rs
@@ -1,7 +1,11 @@
-use werewolves_proto::{game::Category, role};
+use convert_case::{Case, Casing};
+use werewolves_proto::{
+ game::{Category, SetupRole},
+ role::{self, RoleTitle},
+};
use yew::prelude::*;
-use crate::components::{AssociatedIcon, Icon, IconSource, IconType};
+use crate::components::{AssociatedIcon, Icon, IconSource, IconType, PartialAssociatedIcon};
#[derive(Debug, Clone, Copy, PartialEq, Properties)]
pub struct AlignmentSpanProps {
@@ -59,3 +63,21 @@ pub fn CategorySpan(
}
}
+
+#[derive(Debug, Clone, Copy, PartialEq, Properties)]
+pub struct RoleTitleSpanProps {
+ pub role: RoleTitle,
+}
+
+#[function_component]
+pub fn RoleTitleSpan(RoleTitleSpanProps { role }: &RoleTitleSpanProps) -> Html {
+ let class = Into::
::into(*role).category().class();
+ let icon = role.icon().unwrap_or(role.alignment().icon());
+ let text = role.to_string().to_case(Case::Title);
+ html! {
+
+
+ {text}
+
+ }
+}
diff --git a/werewolves/src/components/icon.rs b/werewolves/src/components/icon.rs
index f2b8d08..71b1489 100644
--- a/werewolves/src/components/icon.rs
+++ b/werewolves/src/components/icon.rs
@@ -60,6 +60,7 @@ impl IconSource {
#[derive(Debug, Clone, Copy, PartialEq, Default)]
pub enum IconType {
+ List,
Small,
Informational,
#[default]
@@ -69,6 +70,7 @@ pub enum IconType {
impl IconType {
pub const fn class(&self) -> &'static str {
match self {
+ IconType::List => "icon-in-list",
IconType::Small => "icon",
IconType::Informational => "icon-info",
IconType::RoleCheck => "check-icon",
diff --git a/werewolves/src/components/lobby.rs b/werewolves/src/components/lobby.rs
index bbbdad6..6cd3123 100644
--- a/werewolves/src/components/lobby.rs
+++ b/werewolves/src/components/lobby.rs
@@ -17,7 +17,7 @@ pub fn Lobby(LobbyProps { players, on_action }: &LobbyProps) -> Html {
html! {
{format!("Players in lobby: {}", players.len())}
-
+
{
players
.iter()
diff --git a/werewolves/src/pages/role_page/seer.rs b/werewolves/src/pages/role_page/seer.rs
index bf02fc4..7c4a1e3 100644
--- a/werewolves/src/pages/role_page/seer.rs
+++ b/werewolves/src/pages/role_page/seer.rs
@@ -1,7 +1,9 @@
-use werewolves_proto::role::Alignment;
+use werewolves_proto::role::{Alignment, RoleTitle};
use yew::prelude::*;
-use crate::components::{AssociatedIcon, Icon, IconSource, IconType};
+use crate::components::{
+ AssociatedIcon, Icon, IconSource, IconType, PartialAssociatedIcon, attributes::RoleTitleSpan,
+};
#[function_component]
pub fn SeerPage1() -> Html {
@@ -31,18 +33,42 @@ pub fn SeerResult(SeerResultProps { alignment }: &SeerResultProps) -> Html {
Alignment::Village => "VILLAGE",
Alignment::Wolves => "WOLFPACK",
};
+ let false_positives = match alignment {
+ Alignment::Village => RoleTitle::falsely_appear_village(),
+ Alignment::Wolves => RoleTitle::falsely_appear_wolf(),
+ }
+ .into_iter()
+ .map(|role| {
+ html! {
+
+ }
+ })
+ .collect::();
html! {
}