use super::traits::Renderable
pub struct TypingIndicator {
label: string,
}
impl TypingIndicator {
pub fn new() -> TypingIndicator {
TypingIndicator {
label: String::from("AI is typing"),
}
}
pub fn label(self, label: string) -> TypingIndicator {
self.label = label
self
}
}
impl Renderable for TypingIndicator {
pub fn render(self) -> string {
format!(
"<div class='wj-typing-indicator'>
<div class='wj-typing-dots'>
<span class='wj-typing-dot'></span>
<span class='wj-typing-dot'></span>
<span class='wj-typing-dot'></span>
</div>
<span class='wj-typing-label'>{}</span>
</div>",
self.label
)
}
}