22 lines
646 B
HTML
22 lines
646 B
HTML
|
@use crate::{Button, LinkKind};
|
||
|
|
||
|
@(button: &Button)
|
||
|
|
||
|
<div class="@button.class_string()">
|
||
|
<span>@button.label</span>
|
||
|
@if let Some(href) = button.href.as_ref() {
|
||
|
@match button.link_kind {
|
||
|
LinkKind::CurrentTab => {
|
||
|
<a href="@href" class="toolkit-button--action">@button.label</a>
|
||
|
}
|
||
|
LinkKind::NewTab => {
|
||
|
<a href="@href" target="_blank" rel="noopener noreferer" class="toolkit-button--action">
|
||
|
@button.label
|
||
|
</a>
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
<button class="toolkit-button--action">@button.label</button>
|
||
|
}
|
||
|
</div>
|